Package io.quarkus.vertx.web
Interface ReactiveRoutes.ServerSentEvent<T>
-
- Type Parameters:
T
- the type of payload, use for thedata
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 fromdata()
. Ifevent()
does not returnnull
, theevent
section is written with the result as value. Ifid()
is implemented, theid
section uses this value.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description T
data()
Thedata
section.default String
event()
Theevent
section.default long
id()
Theid
section.
-
-
-
Method Detail
-
event
default String event()
Theevent
section.- Returns:
- the name of the event. If
null
, the written event won't have anevent
section
-
data
T data()
Thedata
section.- Returns:
- the object that will be encoded to JSON. Must not be
null
-
id
default long id()
Theid
section. If not implemented, an automatic id is inserted.- Returns:
- the id
-
-