Module io.inverno.mod.grpc.server
Package io.inverno.mod.grpc.server
Interface GrpcExchangeHandler<A extends ExchangeContext,B extends com.google.protobuf.Message,C extends com.google.protobuf.Message,D extends GrpcRequest<B>,E extends GrpcResponse<C>,F extends GrpcExchange<A,B,C,D,E>>
- Type Parameters:
A
- The exchange context typeB
- The request message typeC
- The response message typeD
- the request typeE
- the response typeF
- the gRPC exchange type
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public interface GrpcExchangeHandler<A extends ExchangeContext,B extends com.google.protobuf.Message,C extends com.google.protobuf.Message,D extends GrpcRequest<B>,E extends GrpcResponse<C>,F extends GrpcExchange<A,B,C,D,E>>
A gRPC exchange handler is used to handle gRPC server exchanges.
- Since:
- 1.9
- Author:
- Jeremy Kuhn
-
Method Summary
-
Method Details
-
defer
Returns a Mono that defers the processing of the exchange.
By default, returns a Mono that defers the execution of
handle(io.inverno.mod.grpc.server.GrpcExchange)
.- Parameters:
exchange
- the gRPC exchange to process- Returns:
- an empty mono that completes when the exchange has been processed
- Throws:
GrpcException
- if an error occurs during the processing of the exchange
-
handle
Processes the specified server exchange.
This method is more convenient than
defer(io.inverno.mod.grpc.server.GrpcExchange)
when the handling logic does not need to be reactive.- Parameters:
exchange
- the gRPC exchange to process- Throws:
GrpcException
- if an error occurs during the processing of the exchange
-