Interface RequestHandler<REQ,RESP>

Type Parameters:
REQ - the request message type
RESP - the response message 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 RequestHandler<REQ,RESP>
Handles an incoming request by completing the given future with a response.

Exceptions thrown from handle(REQ, java.util.concurrent.CompletableFuture<RESP>) are caught by the channel's inner error-handling loop and routed to the ErrorHandler. If the error handler returns true (the default), the channel closes the transport. If it returns false, the channel logs the error and continues processing. When possible, prefer completing the future exceptionally rather than throwing — this records the error in metrics and tracing without consulting the error handler.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    handle(REQ request, CompletableFuture<RESP> response)