Interface ReactiveExchangeHandler<A extends ExchangeContext,B extends Exchange<A>>

Type Parameters:
A - the type of the exchange context
B - the type of exchange handled by the handler
All Known Subinterfaces:
ErrorExchangeHandler<A,B>, ExchangeHandler<A,B>, RootExchangeHandler<A,B>
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 ReactiveExchangeHandler<A extends ExchangeContext,B extends Exchange<A>>

A reactive exchange handler is used to handle server exchanges.

Since:
1.0
Author:
Jeremy Kuhn
See Also:
  • Method Details

    • intercept

      default ReactiveExchangeHandler<A,B> intercept(ExchangeInterceptor<A,B> interceptor)

      Returns a composed exchange handler that first applies the interceptor to transform the exchange and then invoke the defer(io.inverno.mod.http.server.Exchange).

      Parameters:
      interceptor - the interceptor
      Returns:
      a composed exchange handler
    • defer

      reactor.core.publisher.Mono<Void> defer(B exchange)

      Returns a Mono that defers the processing of the exchange.

      The HTTP server will subscribe to the returned Mono and after completion subscribe to the exchange response body data stream to respond to the client.

      Parameters:
      exchange - the exchange to process
      Returns:
      an empty mono that completes when the exchange has been processed