T
- the type of data that this event containspublic final class ServerSentEvent<T> extends Object
Flux<ServerSentEvent>
or Observable<ServerSentEvent>
is the
reactive equivalent to Spring MVC's SseEmitter
.ServerSentEventHttpMessageWriter
,
Server-Sent Events W3C recommendationModifier and Type | Class and Description |
---|---|
static interface |
ServerSentEvent.Builder<T>
A mutable builder for a
SseEvent . |
Modifier and Type | Method and Description |
---|---|
static <T> ServerSentEvent.Builder<T> |
builder()
Return a builder for a
SseEvent . |
static <T> ServerSentEvent.Builder<T> |
builder(T data)
Return a builder for a
SseEvent , populated with the given data. |
String |
comment()
Return the comment of this event, if available.
|
T |
data()
Return the
data field of this event, if available. |
String |
event()
Return the
event field of this event, if available. |
String |
id()
Return the
id field of this event, if available. |
Duration |
retry()
Return the
retry field of this event, if available. |
String |
toString() |
public static <T> ServerSentEvent.Builder<T> builder()
SseEvent
.T
- the type of data that this event containspublic static <T> ServerSentEvent.Builder<T> builder(T data)
SseEvent
, populated with the given data.T
- the type of data that this event contains