Interface EventStreamBody

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 EventStreamBody
Produces a server-sent event stream (see Response.sse(com.jsgalactic.axiom.http.EventStreamBody)). It runs like a StreamBody: once, after the head was sent, on the handler's virtual thread, holding the admission slot and the request deadline. Returning ends the stream; an exception abandons it.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    run(EventSink events)
    Sends the events.
  • Method Details

    • run

      void run(EventSink events) throws Exception
      Sends the events.
      Parameters:
      events - destination, valid until this method returns
      Throws:
      Exception - to abandon the response