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 thisGrpcClient
to a blocking client.default void
close()
Get theGrpcExecutionContext
used during construction of this object.Methods inherited from interface io.servicetalk.concurrent.api.AsyncCloseable
closeAsync, closeAsyncGracefully
Methods inherited from interface io.servicetalk.concurrent.GracefulAutoCloseable
closeGracefully
Methods inherited from interface io.servicetalk.concurrent.api.ListenableAsyncCloseable
onClose, onClosing
-
Method Details
-
asBlockingClient
BlockingClient asBlockingClient()Converts thisGrpcClient
to a blocking client.- Returns:
- This
GrpcClient
as aGrpcClient
.
-
executionContext
GrpcExecutionContext executionContext()Get theGrpcExecutionContext
used 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
GrpcExecutionContext
used during construction of this object.
-
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-