Interface ServerSentEventServer.RequestHandler

Enclosing interface:
ServerSentEventServer
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

Request/response processing contract for ServerSentEventServer implementations.

This is used internally by Soklet instances to "talk" to a ServerSentEventServer via ServerSentEventServer.initialize(SokletConfig, RequestHandler). It's the responsibility of the ServerSentEventServer to implement HTTP mechanics: read bytes from the request, write bytes to the response, and so forth.

Most Soklet applications will use Soklet's default ServerSentEventServer implementation and therefore do not need to implement this interface directly.

Author:
Mark Allen
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    handleRequest(Request request, Consumer<RequestResult> requestResultConsumer)
    Callback to be invoked by a ServerSentEventServer implementation after it has received a Server-Sent Event Source HTTP request but prior to writing initial data to the HTTP response.