Package io.servicetalk.grpc.api
Interface GrpcClientCallFactory
-
- All Superinterfaces:
AsyncCloseable,ListenableAsyncCloseable
public interface GrpcClientCallFactory extends ListenableAsyncCloseable
A factory to create gRPC client call objects for different programming models.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceGrpcClientCallFactory.BlockingClientCall<Req,Resp>An abstraction to make blocking client calls.static interfaceGrpcClientCallFactory.BlockingRequestStreamingClientCall<Req,Resp>An abstraction to make blocking client calls where request is streaming.static interfaceGrpcClientCallFactory.BlockingResponseStreamingClientCall<Req,Resp>An abstraction to make blocking client calls where response is streaming.static interfaceGrpcClientCallFactory.BlockingStreamingClientCall<Req,Resp>An abstraction to make blocking bi-directional streaming client calls.static interfaceGrpcClientCallFactory.ClientCall<Req,Resp>An abstraction to make asynchronous client calls.static interfaceGrpcClientCallFactory.RequestStreamingClientCall<Req,Resp>An abstraction to make asynchronous client calls where request is streaming.static interfaceGrpcClientCallFactory.ResponseStreamingClientCall<Req,Resp>An abstraction to make asynchronous client calls where response is streaming.static interfaceGrpcClientCallFactory.StreamingClientCall<Req,Resp>An abstraction to make asynchronous bi-directional streaming client calls.
-
Method Summary
-
Methods inherited from interface io.servicetalk.concurrent.api.AsyncCloseable
closeAsync, closeAsyncGracefully
-
Methods inherited from interface io.servicetalk.concurrent.api.ListenableAsyncCloseable
onClose
-
-
-
-
Method Detail
-
newCall
<Req,Resp> GrpcClientCallFactory.ClientCall<Req,Resp> newCall(GrpcSerializationProvider serializationProvider, java.lang.Class<Req> requestClass, java.lang.Class<Resp> responseClass)
Creates a newGrpcClientCallFactory.ClientCall.- Type Parameters:
Req- Type of request.Resp- Type of response.- Parameters:
serializationProvider-GrpcSerializationProviderto use.requestClass-Classobject for the request.responseClass-Classobject for the response.- Returns:
GrpcClientCallFactory.ClientCall.
-
newStreamingCall
<Req,Resp> GrpcClientCallFactory.StreamingClientCall<Req,Resp> newStreamingCall(GrpcSerializationProvider serializationProvider, java.lang.Class<Req> requestClass, java.lang.Class<Resp> responseClass)
Creates a newGrpcClientCallFactory.StreamingClientCall.- Type Parameters:
Req- Type of request.Resp- Type of response.- Parameters:
serializationProvider-GrpcSerializationProviderto use.requestClass-Classobject for the request.responseClass-Classobject for the response.- Returns:
GrpcClientCallFactory.StreamingClientCall.
-
newRequestStreamingCall
<Req,Resp> GrpcClientCallFactory.RequestStreamingClientCall<Req,Resp> newRequestStreamingCall(GrpcSerializationProvider serializationProvider, java.lang.Class<Req> requestClass, java.lang.Class<Resp> responseClass)
Creates a newGrpcClientCallFactory.RequestStreamingClientCall.- Type Parameters:
Req- Type of request.Resp- Type of response.- Parameters:
serializationProvider-GrpcSerializationProviderto use.requestClass-Classobject for the request.responseClass-Classobject for the response.- Returns:
GrpcClientCallFactory.RequestStreamingClientCall.
-
newResponseStreamingCall
<Req,Resp> GrpcClientCallFactory.ResponseStreamingClientCall<Req,Resp> newResponseStreamingCall(GrpcSerializationProvider serializationProvider, java.lang.Class<Req> requestClass, java.lang.Class<Resp> responseClass)
Creates a newGrpcClientCallFactory.ResponseStreamingClientCall.- Type Parameters:
Req- Type of request.Resp- Type of response.- Parameters:
serializationProvider-GrpcSerializationProviderto use.requestClass-Classobject for the request.responseClass-Classobject for the response.- Returns:
GrpcClientCallFactory.ResponseStreamingClientCall.
-
newBlockingCall
<Req,Resp> GrpcClientCallFactory.BlockingClientCall<Req,Resp> newBlockingCall(GrpcSerializationProvider serializationProvider, java.lang.Class<Req> requestClass, java.lang.Class<Resp> responseClass)
Creates a newGrpcClientCallFactory.BlockingClientCall.- Type Parameters:
Req- Type of request.Resp- Type of response.- Parameters:
serializationProvider-GrpcSerializationProviderto use.requestClass-Classobject for the request.responseClass-Classobject for the response.- Returns:
GrpcClientCallFactory.BlockingClientCall.
-
newBlockingStreamingCall
<Req,Resp> GrpcClientCallFactory.BlockingStreamingClientCall<Req,Resp> newBlockingStreamingCall(GrpcSerializationProvider serializationProvider, java.lang.Class<Req> requestClass, java.lang.Class<Resp> responseClass)
Creates a newGrpcClientCallFactory.BlockingStreamingClientCall.- Type Parameters:
Req- Type of request.Resp- Type of response.- Parameters:
serializationProvider-GrpcSerializationProviderto use.requestClass-Classobject for the request.responseClass-Classobject for the response.- Returns:
GrpcClientCallFactory.BlockingStreamingClientCall.
-
newBlockingRequestStreamingCall
<Req,Resp> GrpcClientCallFactory.BlockingRequestStreamingClientCall<Req,Resp> newBlockingRequestStreamingCall(GrpcSerializationProvider serializationProvider, java.lang.Class<Req> requestClass, java.lang.Class<Resp> responseClass)
Creates a newGrpcClientCallFactory.BlockingRequestStreamingClientCall.- Type Parameters:
Req- Type of request.Resp- Type of response.- Parameters:
serializationProvider-GrpcSerializationProviderto use.requestClass-Classobject for the request.responseClass-Classobject for the response.- Returns:
GrpcClientCallFactory.BlockingRequestStreamingClientCall.
-
newBlockingResponseStreamingCall
<Req,Resp> GrpcClientCallFactory.BlockingResponseStreamingClientCall<Req,Resp> newBlockingResponseStreamingCall(GrpcSerializationProvider serializationProvider, java.lang.Class<Req> requestClass, java.lang.Class<Resp> responseClass)
Creates a newGrpcClientCallFactory.BlockingResponseStreamingClientCall.- Type Parameters:
Req- Type of request.Resp- Type of response.- Parameters:
serializationProvider-GrpcSerializationProviderto use.requestClass-Classobject for the request.responseClass-Classobject for the response.- Returns:
GrpcClientCallFactory.BlockingResponseStreamingClientCall.
-
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.
-
from
static GrpcClientCallFactory from(StreamingHttpClient httpClient, @Nullable java.time.Duration defaultTimeout)
Creates a newGrpcClientCallFactoryusing the passedStreamingHttpClient.- Parameters:
httpClient-StreamingHttpClientto use. The returnedGrpcClientCallFactorywill own the lifecycle of thisStreamingHttpClient.defaultTimeout-Durationof default timeout or null for no timeout- Returns:
- A new
GrpcClientCallFactory.
-
-