| Package | Description |
|---|---|
| javax.ws.rs.sse |
Server-Sent Events related API.
|
| Modifier and Type | Method and Description |
|---|---|
OutboundSseEvent |
OutboundSseEvent.Builder.build()
Build
OutboundSseEvent. |
default OutboundSseEvent |
Sse.newEvent(String data)
Create new
OutboundSseEvent from provided data. |
default OutboundSseEvent |
Sse.newEvent(String name,
String data)
Create new
OutboundSseEvent from provided data and name. |
| Modifier and Type | Method and Description |
|---|---|
void |
SseBroadcaster.broadcast(OutboundSseEvent event)
Publish an SSE event to all subscribed
SseEventSink instances. |
| Modifier and Type | Method and Description |
|---|---|
void |
SseBroadcaster.onClose(Consumer<Flow.Subscriber<? super OutboundSseEvent>> onClose)
Register a listener, which will be called when the SSE event output has been closed (either by client closing
the connection or by calling
SseEventSink.close() on the server side. |
void |
SseBroadcaster.onError(BiConsumer<Flow.Subscriber<? super OutboundSseEvent>,Throwable> onError)
Register a listener, which will be called when an exception was thrown by a given SSE event output when trying
to write to it or close it.
|
void |
SseBroadcaster.subscribe(Flow.Subscriber<? super OutboundSseEvent> subscriber)
Subscribe
OutboundSseEvent subscriber (i.e. |
Copyright © 1996-2017, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.