Package ratpack.core.sse
Interface ServerSentEventBuilder
-
public interface ServerSentEventBuilder
A server sent event builder.- Since:
- 1.10
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ServerSentEvent
build()
Builds the event.ServerSentEventBuilder
comment(String comment)
Specify a comment to include as part of this event.ServerSentEventBuilder
data(String data)
Specify the event data for the server sent event.ServerSentEventBuilder
event(String event)
Specify the event type for the server sent event.ServerSentEventBuilder
id(String id)
Specify the event id for the server sent event.
-
-
-
Method Detail
-
id
ServerSentEventBuilder id(@Nullable 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 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 String data)
Specify the event data for the server sent event.- Parameters:
data
- the event data- Returns:
- this
-
comment
ServerSentEventBuilder comment(@Nullable 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
-
-