T
- the type of data that this event containspublic class ServerSentEvent<T>
extends java.lang.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 give data. |
java.lang.String |
comment()
Return the comment of this event, if available.
|
T |
data()
Return the
data field of this event, if available. |
java.lang.String |
event()
Return the
event field of this event, if available. |
java.lang.String |
id()
Return the
id field of this event, if available. |
java.time.Duration |
retry()
Return the
retry field of this event, if available. |
java.lang.String |
toString() |
@Nullable public java.lang.String id()
id
field of this event, if available.@Nullable public java.lang.String event()
event
field of this event, if available.@Nullable public java.time.Duration retry()
retry
field of this event, if available.@Nullable public java.lang.String comment()
public java.lang.String toString()
toString
in class java.lang.Object
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 give data.T
- the type of data that this event contains