Package io.servicetalk.grpc.api
Interface GrpcClientCallFactory
- All Superinterfaces:
AsyncCloseable
,ListenableAsyncCloseable
A factory to create gRPC client call objects for different
programming models.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
An abstraction to make blocking client calls.static interface
An abstraction to make blocking client calls where request is streaming.static interface
An abstraction to make blocking client calls where response is streaming.static interface
An abstraction to make blocking bi-directional streaming client calls.static interface
An abstraction to make asynchronous client calls.static interface
An abstraction to make asynchronous client calls where request is streaming.static interface
An abstraction to make asynchronous client calls where response is streaming.static interface
An abstraction to make asynchronous bi-directional streaming client calls. -
Method Summary
Modifier and TypeMethodDescriptionGet theGrpcExecutionContext
used during construction of this object.static GrpcClientCallFactory
from
(StreamingHttpClient httpClient, Duration defaultTimeout) Creates a newGrpcClientCallFactory
using the passedStreamingHttpClient
.<Req,
Resp> GrpcClientCallFactory.BlockingClientCall<Req, Resp> newBlockingCall
(GrpcSerializationProvider serializationProvider, Class<Req> requestClass, Class<Resp> responseClass) Deprecated.<Req,
Resp> GrpcClientCallFactory.BlockingClientCall<Req, Resp> newBlockingCall
(MethodDescriptor<Req, Resp> methodDescriptor, BufferDecoderGroup decompressors) Create a newGrpcClientCallFactory.BlockingClientCall
.<Req,
Resp> GrpcClientCallFactory.BlockingRequestStreamingClientCall<Req, Resp> newBlockingRequestStreamingCall
(GrpcSerializationProvider serializationProvider, Class<Req> requestClass, Class<Resp> responseClass) <Req,
Resp> GrpcClientCallFactory.BlockingRequestStreamingClientCall<Req, Resp> newBlockingRequestStreamingCall
(MethodDescriptor<Req, Resp> methodDescriptor, BufferDecoderGroup decompressors) Create a newGrpcClientCallFactory.BlockingRequestStreamingClientCall
.<Req,
Resp> GrpcClientCallFactory.BlockingResponseStreamingClientCall<Req, Resp> newBlockingResponseStreamingCall
(GrpcSerializationProvider serializationProvider, Class<Req> requestClass, Class<Resp> responseClass) <Req,
Resp> GrpcClientCallFactory.BlockingResponseStreamingClientCall<Req, Resp> newBlockingResponseStreamingCall
(MethodDescriptor<Req, Resp> methodDescriptor, BufferDecoderGroup decompressors) <Req,
Resp> GrpcClientCallFactory.BlockingStreamingClientCall<Req, Resp> newBlockingStreamingCall
(GrpcSerializationProvider serializationProvider, Class<Req> requestClass, Class<Resp> responseClass) Deprecated.<Req,
Resp> GrpcClientCallFactory.BlockingStreamingClientCall<Req, Resp> newBlockingStreamingCall
(MethodDescriptor<Req, Resp> methodDescriptor, BufferDecoderGroup decompressors) Create a newGrpcClientCallFactory.BlockingStreamingClientCall
.<Req,
Resp> GrpcClientCallFactory.ClientCall<Req, Resp> newCall
(GrpcSerializationProvider serializationProvider, Class<Req> requestClass, Class<Resp> responseClass) Deprecated.<Req,
Resp> GrpcClientCallFactory.ClientCall<Req, Resp> newCall
(MethodDescriptor<Req, Resp> methodDescriptor, BufferDecoderGroup decompressors) Create a newGrpcClientCallFactory.ClientCall
.<Req,
Resp> GrpcClientCallFactory.RequestStreamingClientCall<Req, Resp> newRequestStreamingCall
(GrpcSerializationProvider serializationProvider, Class<Req> requestClass, Class<Resp> responseClass) Deprecated.<Req,
Resp> GrpcClientCallFactory.RequestStreamingClientCall<Req, Resp> newRequestStreamingCall
(MethodDescriptor<Req, Resp> methodDescriptor, BufferDecoderGroup decompressors) Create a newGrpcClientCallFactory.RequestStreamingClientCall
.<Req,
Resp> GrpcClientCallFactory.ResponseStreamingClientCall<Req, Resp> newResponseStreamingCall
(GrpcSerializationProvider serializationProvider, Class<Req> requestClass, Class<Resp> responseClass) Deprecated.<Req,
Resp> GrpcClientCallFactory.ResponseStreamingClientCall<Req, Resp> newResponseStreamingCall
(MethodDescriptor<Req, Resp> methodDescriptor, BufferDecoderGroup decompressors) Create a newGrpcClientCallFactory.ResponseStreamingClientCall
.<Req,
Resp> GrpcClientCallFactory.StreamingClientCall<Req, Resp> newStreamingCall
(GrpcSerializationProvider serializationProvider, Class<Req> requestClass, Class<Resp> responseClass) Deprecated.<Req,
Resp> GrpcClientCallFactory.StreamingClientCall<Req, Resp> newStreamingCall
(MethodDescriptor<Req, Resp> methodDescriptor, BufferDecoderGroup decompressors) Create a newGrpcClientCallFactory.StreamingClientCall
.Methods inherited from interface io.servicetalk.concurrent.api.AsyncCloseable
closeAsync, closeAsyncGracefully
Methods inherited from interface io.servicetalk.concurrent.api.ListenableAsyncCloseable
onClose, onClosing
-
Method Details
-
newCall
@Deprecated <Req,Resp> GrpcClientCallFactory.ClientCall<Req,Resp> newCall(GrpcSerializationProvider serializationProvider, Class<Req> requestClass, Class<Resp> responseClass) Deprecated.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
.
-
newCall
<Req,Resp> GrpcClientCallFactory.ClientCall<Req,Resp> newCall(MethodDescriptor<Req, Resp> methodDescriptor, BufferDecoderGroup decompressors) Create a newGrpcClientCallFactory.ClientCall
.- Type Parameters:
Req
- Type of request.Resp
- Type of response.- Parameters:
methodDescriptor
- describes the method characteristics and how to do serialization of individual objects.decompressors
- describes the decompression that is supported for this call.- Returns:
GrpcClientCallFactory.ClientCall
.
-
newStreamingCall
@Deprecated <Req,Resp> GrpcClientCallFactory.StreamingClientCall<Req,Resp> newStreamingCall(GrpcSerializationProvider serializationProvider, Class<Req> requestClass, Class<Resp> responseClass) Deprecated.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
.
-
newStreamingCall
<Req,Resp> GrpcClientCallFactory.StreamingClientCall<Req,Resp> newStreamingCall(MethodDescriptor<Req, Resp> methodDescriptor, BufferDecoderGroup decompressors) Create a newGrpcClientCallFactory.StreamingClientCall
.- Type Parameters:
Req
- Type of request.Resp
- Type of response.- Parameters:
methodDescriptor
- describes the method characteristics and how to do serialization of individual objects.decompressors
- describes the decompression that is supported for this call.- Returns:
GrpcClientCallFactory.StreamingClientCall
.
-
newRequestStreamingCall
@Deprecated <Req,Resp> GrpcClientCallFactory.RequestStreamingClientCall<Req,Resp> newRequestStreamingCall(GrpcSerializationProvider serializationProvider, Class<Req> requestClass, Class<Resp> responseClass) Deprecated.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
.
-
newRequestStreamingCall
<Req,Resp> GrpcClientCallFactory.RequestStreamingClientCall<Req,Resp> newRequestStreamingCall(MethodDescriptor<Req, Resp> methodDescriptor, BufferDecoderGroup decompressors) Create a newGrpcClientCallFactory.RequestStreamingClientCall
.- Type Parameters:
Req
- Type of request.Resp
- Type of response.- Parameters:
methodDescriptor
- describes the method characteristics and how to do serialization of individual objects.decompressors
- describes the decompression that is supported for this call.- Returns:
GrpcClientCallFactory.RequestStreamingClientCall
.
-
newResponseStreamingCall
@Deprecated <Req,Resp> GrpcClientCallFactory.ResponseStreamingClientCall<Req,Resp> newResponseStreamingCall(GrpcSerializationProvider serializationProvider, Class<Req> requestClass, Class<Resp> responseClass) Deprecated.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
.
-
newResponseStreamingCall
<Req,Resp> GrpcClientCallFactory.ResponseStreamingClientCall<Req,Resp> newResponseStreamingCall(MethodDescriptor<Req, Resp> methodDescriptor, BufferDecoderGroup decompressors) Create a newGrpcClientCallFactory.ResponseStreamingClientCall
.- Type Parameters:
Req
- Type of request.Resp
- Type of response.- Parameters:
methodDescriptor
- describes the method characteristics and how to do serialization of individual objects.decompressors
- describes the decompression that is supported for this call.- Returns:
GrpcClientCallFactory.ResponseStreamingClientCall
.
-
newBlockingCall
@Deprecated <Req,Resp> GrpcClientCallFactory.BlockingClientCall<Req,Resp> newBlockingCall(GrpcSerializationProvider serializationProvider, Class<Req> requestClass, Class<Resp> responseClass) Deprecated.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
.
-
newBlockingCall
<Req,Resp> GrpcClientCallFactory.BlockingClientCall<Req,Resp> newBlockingCall(MethodDescriptor<Req, Resp> methodDescriptor, BufferDecoderGroup decompressors) Create a newGrpcClientCallFactory.BlockingClientCall
.- Type Parameters:
Req
- Type of request.Resp
- Type of response.- Parameters:
methodDescriptor
- describes the method characteristics and how to do serialization of individual objects.decompressors
- describes the decompression that is supported for this call.- Returns:
GrpcClientCallFactory.BlockingClientCall
.
-
newBlockingStreamingCall
@Deprecated <Req,Resp> GrpcClientCallFactory.BlockingStreamingClientCall<Req,Resp> newBlockingStreamingCall(GrpcSerializationProvider serializationProvider, Class<Req> requestClass, Class<Resp> responseClass) Deprecated.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
.
-
newBlockingStreamingCall
<Req,Resp> GrpcClientCallFactory.BlockingStreamingClientCall<Req,Resp> newBlockingStreamingCall(MethodDescriptor<Req, Resp> methodDescriptor, BufferDecoderGroup decompressors) Create a newGrpcClientCallFactory.BlockingStreamingClientCall
.- Type Parameters:
Req
- Type of request.Resp
- Type of response.- Parameters:
methodDescriptor
- describes the method characteristics and how to do serialization of individual objects.decompressors
- describes the decompression that is supported for this call.- Returns:
GrpcClientCallFactory.BlockingStreamingClientCall
.
-
newBlockingRequestStreamingCall
@Deprecated <Req,Resp> GrpcClientCallFactory.BlockingRequestStreamingClientCall<Req,Resp> newBlockingRequestStreamingCall(GrpcSerializationProvider serializationProvider, Class<Req> requestClass, 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
.
-
newBlockingRequestStreamingCall
<Req,Resp> GrpcClientCallFactory.BlockingRequestStreamingClientCall<Req,Resp> newBlockingRequestStreamingCall(MethodDescriptor<Req, Resp> methodDescriptor, BufferDecoderGroup decompressors) Create a newGrpcClientCallFactory.BlockingRequestStreamingClientCall
.- Type Parameters:
Req
- Type of request.Resp
- Type of response.- Parameters:
methodDescriptor
- describes the method characteristics and how to do serialization of individual objects.decompressors
- describes the decompression that is supported for this call.- Returns:
GrpcClientCallFactory.BlockingRequestStreamingClientCall
.
-
newBlockingResponseStreamingCall
@Deprecated <Req,Resp> GrpcClientCallFactory.BlockingResponseStreamingClientCall<Req,Resp> newBlockingResponseStreamingCall(GrpcSerializationProvider serializationProvider, Class<Req> requestClass, 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
.
-
newBlockingResponseStreamingCall
<Req,Resp> GrpcClientCallFactory.BlockingResponseStreamingClientCall<Req,Resp> newBlockingResponseStreamingCall(MethodDescriptor<Req, Resp> methodDescriptor, BufferDecoderGroup decompressors) - Type Parameters:
Req
- Type of request.Resp
- Type of response.- Parameters:
methodDescriptor
- describes the method characteristics and how to do serialization of individual objects.decompressors
- describes the decompression that is supported for this call.- 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 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
.
-
newBlockingCall(MethodDescriptor, BufferDecoderGroup)
.