Interface ReactiveRoutes.ServerSentEvent<T>

Type Parameters:
T - the type of payload, use for the data section of the event.
Enclosing class:
ReactiveRoutes

public static interface ReactiveRoutes.ServerSentEvent<T>
A class allowing to customize how the server sent events are written.

The data section of the resulting event is the JSON representation of the result from data(). If event() does not return null, the event section is written with the result as value. If id() is implemented, the id section uses this value.

  • Method Summary

    Modifier and Type
    Method
    Description
    The data section.
    default String
    The event section.
    default long
    id()
    The id section.
  • Method Details

    • event

      default String event()
      The event section.
      Returns:
      the name of the event. If null, the written event won't have an event section
    • data

      T data()
      The data section.
      Returns:
      the object that will be encoded to JSON. Must not be null
    • id

      default long id()
      The id section. If not implemented, an automatic id is inserted.
      Returns:
      the id