API 参考 / @142vip/grpc / GrpcClient
类: GrpcClient
Grpc 客户端
构造函数
构造函数
new GrpcClient(
connectUri
):GrpcClient
参数
connectUri
string
返回
GrpcClient
方法
getConnectUri()
getConnectUri():
string
获取连接地址
返回
string
getService()
getService<
T
>(servicePath
):T
获取连接Service
类型参数
T
T
参数
servicePath
string
返回
T
getServicePaths()
getServicePaths():
string
[]
获取所有的服务路径
返回
string
[]
getServiceSize()
getServiceSize():
number
获取连接数
返回
number
registerService()
registerService(
servicePath
,IServiceClientConstructor
):void
建立连接
参数
servicePath
string
IServiceClientConstructor
ServiceClientConstructor
返回
void
removeService()
removeService(
servicePath?
):void
关闭gRPC连接
- 异步关闭
参数
servicePath?
string
返回
void