Interface Source<T>

Type Parameters:
T - event type
All Known Subinterfaces:
SseSource
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 Source<T>
A listener for arbitrary events.
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    default void
    Handler for event stream termination.
    default void
    Handler for errors encountered during processing of source.
    void
    onEvent(T event)
    Handler for a newly received event.
    default void
    Handler for event stream creation.
  • Method Details Link icon

    • onOpen Link icon

      default void onOpen()
      Handler for event stream creation.
    • onEvent Link icon

      void onEvent(T event)
      Handler for a newly received event.
      Parameters:
      event - the event
    • onClose Link icon

      default void onClose()
      Handler for event stream termination.
    • onError Link icon

      default void onError(Throwable t)
      Handler for errors encountered during processing of source.
      Parameters:
      t - a throwable