类 ServerSentEvent<T>
- java.lang.Object
- org.springframework.http.codec.ServerSentEvent<T>
- 类型参数:
T- the type of data that this event contains
public final class ServerSentEvent<T> extends Object
Representation for a Server-Sent Event for use with Spring's reactive Web support.Flux<ServerSentEvent>orObservable<ServerSentEvent>is the reactive equivalent to Spring MVC'sSseEmitter.- 从以下版本开始:
- 5.0
- 作者:
- Sebastien Deleuze, Arjen Poutsma
- 另请参阅:
ServerSentEventHttpMessageWriter, Server-Sent Events W3C recommendation
嵌套类概要
嵌套类 修饰符和类型 类 说明 static interfaceServerSentEvent.Builder<T>A mutable builder for aSseEvent.
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 static <T> ServerSentEvent.Builder<T>builder()Return a builder for aSseEvent.static <T> ServerSentEvent.Builder<T>builder(T data)Return a builder for aSseEvent, populated with the give data.Stringcomment()Return the comment of this event, if available.Tdata()Return thedatafield of this event, if available.Stringevent()Return theeventfield of this event, if available.Stringid()Return theidfield of this event, if available.Durationretry()Return theretryfield of this event, if available.StringtoString()
方法详细资料
builder
public static <T> ServerSentEvent.Builder<T> builder()
Return a builder for aSseEvent.- 类型参数:
T- the type of data that this event contains- 返回:
- the builder
builder
public static <T> ServerSentEvent.Builder<T> builder(T data)
Return a builder for aSseEvent, populated with the give data.- 类型参数:
T- the type of data that this event contains- 返回:
- the builder