Interface GrpcExchange<A extends ExchangeContext,B extends com.google.protobuf.Message,C extends com.google.protobuf.Message,D extends GrpcRequest<B>,E extends GrpcResponse<C>>
- Type Parameters:
A
- The exchange context typeB
- The request message typeC
- The response message typeD
- the request typeE
- the response type
- All Superinterfaces:
GrpcBaseExchange<A,
D, Mono<? extends E>>
- All Known Subinterfaces:
GrpcExchange.BidirectionalStreaming<A,
,B, C> GrpcExchange.ClientStreaming<A,
,B, C> GrpcExchange.ServerStreaming<A,
,B, C> GrpcExchange.Unary<A,
B, C>
Represents a gRPC client exchange between a client and a server.
A client gRPC exchange is obtained by converting an HTTP client exchange with the GrpcClient
into one of
GrpcExchange.Unary
, GrpcExchange.ClientStreaming
, GrpcExchange.ServerStreaming
or GrpcExchange.BidirectionalStreaming
exchange which reflect the four kinds of
service method defined by gRPC core concepts.
The GrpcRequest
and GrpcResponse
exposed by each type of exchange reflect their specific communication form. For instance, a unary exchange shall only provide single request and
response messages and one response message whereas a bidirectional streaming exchange shall provide request and response message publishers.
As for an client HTTP Exchange
, the actual gRPC request is only sent when the exchange's response message publisher is subscribed.
The client exchange terminates when the response message publisher terminates, gRPC metadata are then received by the client with final GrpcStatus
.
- Since:
- 1.9
- Author:
- Jeremy Kuhn
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
GrpcExchange.BidirectionalStreaming<A extends ExchangeContext,
B extends com.google.protobuf.Message, C extends com.google.protobuf.Message> Represents a bidirectional streaming (stream/stream) client gRPC exchange.static interface
GrpcExchange.ClientStreaming<A extends ExchangeContext,
B extends com.google.protobuf.Message, C extends com.google.protobuf.Message> Represents a client streaming (stream/response) client gRPC exchange.static interface
GrpcExchange.ServerStreaming<A extends ExchangeContext,
B extends com.google.protobuf.Message, C extends com.google.protobuf.Message> Represents a server streaming (request/stream) client gRPC exchange.static interface
GrpcExchange.Unary<A extends ExchangeContext,
B extends com.google.protobuf.Message, C extends com.google.protobuf.Message> Represents a unary (request/response) client gRPC exchange. -
Method Summary
Methods inherited from interface io.inverno.mod.grpc.base.GrpcBaseExchange
cancel, context, getCancelCause, request, response