public interface Sse
OutboundSseEvent
and SseBroadcaster
.
Instance of this interface can be injected into a field or as a parameter of a method or a constructor. Also, the instance is thread safe, meaning that it can be shared and its method invoked from different threads without causing inconsistent internal state.
Modifier and Type | Method and Description |
---|---|
SseBroadcaster |
newBroadcaster()
Get a new Server-sent event broadcaster.
|
default OutboundSseEvent |
newEvent(String data)
Create new
OutboundSseEvent from provided data. |
default OutboundSseEvent |
newEvent(String name,
String data)
Create new
OutboundSseEvent from provided data and name. |
OutboundSseEvent.Builder |
newEventBuilder()
Get a new outbound event builder.
|
OutboundSseEvent.Builder newEventBuilder()
default OutboundSseEvent newEvent(String data)
OutboundSseEvent
from provided data.
The data can be string only and must not be null.
data
- event data.OutboundSseEvent
.IllegalArgumentException
- when data is null
.default OutboundSseEvent newEvent(String name, String data)
OutboundSseEvent
from provided data and name.name
- event name. (see SseEvent.getName()
).data
- event data.OutboundSseEvent
.IllegalArgumentException
- when name or data is null
.SseBroadcaster newBroadcaster()
Copyright © 2018,2020 Eclipse Foundation.
Use is subject to license terms.