Interface SseHandler

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 SseHandler
Handler for Server-Sent Events (SSE) connections. Called when a client sends a request with "Accept: text/event-stream". The handler receives the request and an open SSE connection to send events on.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    accept(HttpRequest request, SseConnection connection)
    Handle an SSE connection.
  • Method Details

    • accept

      void accept(HttpRequest request, SseConnection connection)
      Handle an SSE connection. This method is called on a Netty worker thread. Implementations should typically hand off to a background thread for long-running event streams and return promptly.
      Parameters:
      request - the HTTP request that initiated the SSE connection
      connection - the SSE connection to send events on