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

    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

    • onOpen

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

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

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

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