public abstract class GrpcClient extends RpcClient
RpcClient.ConnectionEvent, RpcClient.ServerInfo| 限定符和类型 | 字段和说明 |
|---|---|
protected static String |
NACOS_SERVER_GRPC_PORT_OFFSET_KEY |
clientAbilities, clientEventExecutor, connectionEventListeners, currentConnection, eventLinkedBlockingQueue, labels, rpcClientStatus, serverRequestHandlers| 构造器和说明 |
|---|
GrpcClient(String name)
Empty constructor.
|
| 限定符和类型 | 方法和说明 |
|---|---|
Connection |
connectToServer(RpcClient.ServerInfo serverInfo)
connect to server.
|
protected ThreadPoolExecutor |
createGrpcExecutor(String serverIp) |
ConnectionType |
getConnectionType()
get connection type of this client.
|
protected Integer |
getThreadPoolCoreSize() |
protected Integer |
getThreadPoolMaxSize() |
void |
setThreadPoolCoreSize(Integer threadPoolCoreSize)
Set core size of thread pool.
|
void |
setThreadPoolMaxSize(Integer threadPoolMaxSize)
Set max size of thread pool.
|
void |
shutdown()
Shutdown the Resources, such as Thread Pool.
|
asyncRequest, clientAbilities, currentRpcServer, getCurrentServer, getLabels, getName, getServerListFactory, getTenant, handleServerRequest, isRunning, isShutdown, isWaitInitiated, keepAlive, labels, nextRpcServer, notifyConnected, notifyDisConnected, onServerListChange, reconnect, registerConnectionListener, registerServerRequestHandler, request, request, requestFuture, rpcPortOffset, serverListFactory, setName, setTenant, start, switchServerAsync, switchServerAsync, switchServerAsyncOnRequestFailpublic GrpcClient(String name)
public ConnectionType getConnectionType()
RpcClientgetConnectionType 在类中 RpcClientpublic void setThreadPoolCoreSize(Integer threadPoolCoreSize)
threadPoolCoreSize - core size of thread pool for grpc.public void setThreadPoolMaxSize(Integer threadPoolMaxSize)
threadPoolMaxSize - max size of thread pool for grpc.protected Integer getThreadPoolCoreSize()
protected Integer getThreadPoolMaxSize()
protected ThreadPoolExecutor createGrpcExecutor(String serverIp)
public void shutdown()
throws NacosException
Closeableshutdown 在接口中 Closeableshutdown 在类中 RpcClientNacosException - exception.public Connection connectToServer(RpcClient.ServerInfo serverInfo)
RpcClientconnectToServer 在类中 RpcClientserverInfo - server address to connect.Copyright © 2018–2022 Alibaba Group. All rights reserved.