public class GrpcClient extends Object implements RpcClient
RpcClient.ConnectionObserver| Constructor and Description |
|---|
GrpcClient(MarshallerRegistry marshallerRegistry) |
| Modifier and Type | Method and Description |
|---|---|
void |
addInterceptor(io.grpc.ClientInterceptor interceptor) |
boolean |
checkConnection(io.greptime.common.Endpoint endpoint) |
boolean |
checkConnection(io.greptime.common.Endpoint endpoint,
boolean createIfAbsent) |
void |
closeConnection(io.greptime.common.Endpoint endpoint) |
void |
display(io.greptime.common.Display.Printer out) |
boolean |
init(RpcOptions opts) |
<Req,Resp> void |
invokeAsync(io.greptime.common.Endpoint endpoint,
Req request,
Context ctx,
Observer<Resp> observer,
long timeoutMs) |
<Req,Resp> Observer<Req> |
invokeClientStreaming(io.greptime.common.Endpoint endpoint,
Req defaultReqIns,
Context ctx,
Observer<Resp> respObserver) |
<Req,Resp> void |
invokeServerStreaming(io.greptime.common.Endpoint endpoint,
Req request,
Context ctx,
Observer<Resp> observer) |
<Req,Resp> Resp |
invokeSync(io.greptime.common.Endpoint endpoint,
Req request,
Context ctx,
long timeoutMs) |
void |
registerConnectionObserver(RpcClient.ConnectionObserver observer) |
void |
shutdownGracefully() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinvokeAsync, invokeSyncpublic GrpcClient(MarshallerRegistry marshallerRegistry)
public boolean init(RpcOptions opts)
init in interface io.greptime.common.Lifecycle<RpcOptions>public void shutdownGracefully()
shutdownGracefully in interface io.greptime.common.Lifecycle<RpcOptions>public boolean checkConnection(io.greptime.common.Endpoint endpoint)
checkConnection in interface RpcClientpublic boolean checkConnection(io.greptime.common.Endpoint endpoint,
boolean createIfAbsent)
checkConnection in interface RpcClientpublic void closeConnection(io.greptime.common.Endpoint endpoint)
closeConnection in interface RpcClientpublic void registerConnectionObserver(RpcClient.ConnectionObserver observer)
registerConnectionObserver in interface RpcClientpublic <Req,Resp> Resp invokeSync(io.greptime.common.Endpoint endpoint,
Req request,
Context ctx,
long timeoutMs)
throws RemotingException
invokeSync in interface RpcClientRemotingExceptionpublic <Req,Resp> void invokeAsync(io.greptime.common.Endpoint endpoint,
Req request,
Context ctx,
Observer<Resp> observer,
long timeoutMs)
invokeAsync in interface RpcClientpublic <Req,Resp> void invokeServerStreaming(io.greptime.common.Endpoint endpoint,
Req request,
Context ctx,
Observer<Resp> observer)
invokeServerStreaming in interface RpcClientpublic <Req,Resp> Observer<Req> invokeClientStreaming(io.greptime.common.Endpoint endpoint, Req defaultReqIns, Context ctx, Observer<Resp> respObserver)
invokeClientStreaming in interface RpcClientpublic void addInterceptor(io.grpc.ClientInterceptor interceptor)
public void display(io.greptime.common.Display.Printer out)
display in interface io.greptime.common.DisplayCopyright © 2023. All rights reserved.