类 ServerSentEvent<T>

java.lang.Object
cn.taketoday.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 reactive Web support. Flux<ServerSentEvent> or Observable<ServerSentEvent>
从以下版本开始:
4.0
作者:
Sebastien Deleuze, Arjen Poutsma, Harry Yang
另请参阅:
  • 字段详细资料

    • id

      @Nullable private final String id
    • event

      @Nullable private final String event
    • retry

      @Nullable private final Duration retry
    • comment

      @Nullable private final String comment
    • data

      @Nullable private final T data
  • 构造器详细资料

    • ServerSentEvent

      private ServerSentEvent(@Nullable String id, @Nullable String event, @Nullable Duration retry, @Nullable String comment, @Nullable T data)
  • 方法详细资料

    • id

      @Nullable public String id()
      Return the id field of this event, if available.
    • event

      @Nullable public String event()
      Return the event field of this event, if available.
    • retry

      @Nullable public Duration retry()
      Return the retry field of this event, if available.
    • comment

      @Nullable public String comment()
      Return the comment of this event, if available.
    • data

      @Nullable public T data()
      Return the data field of this event, if available.
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object
    • builder

      public static <T> ServerSentEvent.Builder<T> builder()
      Return a builder for a SseEvent.
      类型参数:
      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 a SseEvent, populated with the given data.
      类型参数:
      T - the type of data that this event contains
      返回:
      the builder