Package com.linecorp.armeria.common.sse
Interface ServerSentEvent
public interface ServerSentEvent
An interface for the Server-Sent Events specification.
If a
Publisher
or Stream
produces objects which implement this interface, it can be
converted into a text event stream by ServerSentEventResponseConverterFunction
.-
Method Summary
Modifier and TypeMethodDescriptionstatic ServerSentEventBuilder
builder()
Returns a newly createdServerSentEventBuilder
.comment()
Returns a comment of this event, if it exists.data()
Returns a data of this event, if it exists.static ServerSentEvent
empty()
Returns a singleton emptyServerSentEvent
.event()
Returns an event name of this event, if it exists.id()
Returns an ID of this event, if it exists.static ServerSentEvent
Creates a newServerSentEvent
with the specifiedcomment
.static ServerSentEvent
Creates a newServerSentEvent
with the specifieddata
.static ServerSentEvent
Creates a newServerSentEvent
with the specifiedevent
.static ServerSentEvent
Creates a newServerSentEvent
with the specifiedid
.static ServerSentEvent
Creates a newServerSentEvent
with the specifiedretry
.retry()
Returns a reconnection time in milliseconds, if it exists.
-
Method Details
-
empty
Returns a singleton emptyServerSentEvent
. -
ofId
Creates a newServerSentEvent
with the specifiedid
. -
ofEvent
Creates a newServerSentEvent
with the specifiedevent
. -
ofRetry
Creates a newServerSentEvent
with the specifiedretry
. -
ofComment
Creates a newServerSentEvent
with the specifiedcomment
. -
ofData
Creates a newServerSentEvent
with the specifieddata
. -
builder
Returns a newly createdServerSentEventBuilder
. -
id
Returns an ID of this event, if it exists. Otherwise,null
will be returned. -
event
Returns an event name of this event, if it exists. Otherwise,null
will be returned. -
retry
Returns a reconnection time in milliseconds, if it exists. Otherwise,null
will be returned. -
comment
Returns a comment of this event, if it exists. Otherwise,null
will be returned. -
data
Returns a data of this event, if it exists. Otherwise,null
will be returned.
-