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 interface
GrpcClientCallFactory.BlockingClientCall<Req,Resp>
An abstraction to make blocking client calls.static interface
GrpcClientCallFactory.BlockingRequestStreamingClientCall<Req,Resp>
An abstraction to make blocking client calls where request is streaming.static interface
GrpcClientCallFactory.BlockingResponseStreamingClientCall<Req,Resp>
An abstraction to make blocking client calls where response is streaming.static interface
GrpcClientCallFactory.BlockingStreamingClientCall<Req,Resp>
An abstraction to make blocking bi-directional streaming client calls.static interface
GrpcClientCallFactory.ClientCall<Req,Resp>
An abstraction to make asynchronous client calls.static interface
GrpcClientCallFactory.RequestStreamingClientCall<Req,Resp>
An abstraction to make asynchronous client calls where request is streaming.static interface
GrpcClientCallFactory.ResponseStreamingClientCall<Req,Resp>
An abstraction to make asynchronous client calls where response is streaming.static interface
GrpcClientCallFactory.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
-GrpcSerializationProvider
to use.requestClass
-Class
object for the request.responseClass
-Class
object 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
-GrpcSerializationProvider
to use.requestClass
-Class
object for the request.responseClass
-Class
object 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
-GrpcSerializationProvider
to use.requestClass
-Class
object for the request.responseClass
-Class
object 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
-GrpcSerializationProvider
to use.requestClass
-Class
object for the request.responseClass
-Class
object 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
-GrpcSerializationProvider
to use.requestClass
-Class
object for the request.responseClass
-Class
object 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
-GrpcSerializationProvider
to use.requestClass
-Class
object for the request.responseClass
-Class
object 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
-GrpcSerializationProvider
to use.requestClass
-Class
object for the request.responseClass
-Class
object 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
-GrpcSerializationProvider
to use.requestClass
-Class
object for the request.responseClass
-Class
object for the response.- Returns:
GrpcClientCallFactory.BlockingResponseStreamingClientCall
.
-
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.
-
from
static GrpcClientCallFactory from(StreamingHttpClient httpClient, @Nullable java.time.Duration defaultTimeout)
Creates a newGrpcClientCallFactory
using the passedStreamingHttpClient
.- Parameters:
httpClient
-StreamingHttpClient
to use. The returnedGrpcClientCallFactory
will own the lifecycle of thisStreamingHttpClient
.defaultTimeout
-Duration
of default timeout or null for no timeout- Returns:
- A new
GrpcClientCallFactory
.
-
-