Package ratpack.sse

Interface ServerSentEventBuilder


  • public interface ServerSentEventBuilder
    A server sent event builder.
    Since:
    1.10
    • Method Detail

      • id

        ServerSentEventBuilder id​(@Nullable
                                  java.lang.String id)
        Specify the event id for the server sent event.

        The value must not contain a '\n' character as this is not valid in an event value.

        Parameters:
        id - the event id
        Returns:
        this
      • event

        ServerSentEventBuilder event​(@Nullable
                                     java.lang.String event)
        Specify the event type for the server sent event.

        The value must not contain a '\n' character as this is not valid in an event value.

        Parameters:
        event - the event type
        Returns:
        this
      • data

        ServerSentEventBuilder data​(@Nullable
                                    java.lang.String data)
        Specify the event data for the server sent event.
        Parameters:
        data - the event data
        Returns:
        this
      • comment

        ServerSentEventBuilder comment​(@Nullable
                                       java.lang.String comment)
        Specify a comment to include as part of this event.
        Parameters:
        comment - the comment data
        Returns:
        this
      • build

        ServerSentEvent build()
        Builds the event.
        Returns:
        the built event