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 type
B - The request message type
C - The response message type
D - the request type
E - the response type
F - 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

    Modifier and Type
    Method
    Description
    default Mono<Void>
    defer(F exchange)
    Returns a Mono that defers the processing of the exchange.
    void
    handle(F exchange)
    Processes the specified server exchange.
  • Method Details

    • defer

      default Mono<Void> defer(F exchange) throws GrpcException

      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

      void handle(F exchange) throws GrpcException

      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