Package io.servicetalk.grpc.api
Interface GrpcClient<BlockingClient extends BlockingGrpcClient>
- Type Parameters:
BlockingClient- The correspondingBlockingGrpcClient
- All Superinterfaces:
AsyncCloseable,AutoCloseable,GracefulAutoCloseable,ListenableAsyncCloseable
- All Known Subinterfaces:
Health.HealthClient
public interface GrpcClient<BlockingClient extends BlockingGrpcClient>
extends ListenableAsyncCloseable, GracefulAutoCloseable
A client to a gRPC service.
-
Method Summary
Modifier and TypeMethodDescriptionConverts thisGrpcClientto a blocking client.default voidclose()Get theGrpcExecutionContextused during construction of this object.Methods inherited from interface io.servicetalk.concurrent.api.AsyncCloseable
closeAsync, closeAsyncGracefullyMethods inherited from interface io.servicetalk.concurrent.GracefulAutoCloseable
closeGracefullyMethods inherited from interface io.servicetalk.concurrent.api.ListenableAsyncCloseable
onClose, onClosing
-
Method Details
-
asBlockingClient
BlockingClient asBlockingClient()Converts thisGrpcClientto a blocking client.- Returns:
- This
GrpcClientas aGrpcClient.
-
executionContext
GrpcExecutionContext executionContext()Get theGrpcExecutionContextused during construction of this object.Note that the
ExecutionContext.ioExecutor()will not necessarily be associated with a specific thread unless that was how this object was built.- Returns:
- the
GrpcExecutionContextused during construction of this object.
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-