SimplePushEventSource is a helper that makes it simpler to write a
PushEventSource. Users do not need to manage multiple registrations
to the stream, nor do they have to be concerned with back pressure.
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public Promise | Returns: A promise representing the connection state of this EventSourceThis method can be used to delay event generation until an event source has connected. |
| public void | |
| public void | |
| public boolean | Returns: true if any consumers are currently connectedDetermine whether there are any |
| public void | publish(T t)
Asynchronously publish an event to this stream and all connected
|
| close | back to summary |
|---|---|
| public void close() Redeclares java. Close this source. Calling this method indicates that there will never be
any more events published by it. Calling this method sends a close event
to all connected consumers. After calling this method any
| |
| connectPromise | back to summary |
|---|---|
| public Promise This method can be used to delay event generation until an event source
has connected. The returned promise will resolve as soon as one or more
The returned promise may already be resolved if this
Note that the connected consumers are able to asynchronously close their
connections to this | |
| endOfStream | back to summary |
|---|---|
| public void endOfStream() Close this source for now, but potentially reopen it later. Calling this
method asynchronously sends a close event to all connected consumers and
then disconnects them. Any events previously queued by the
After calling this method any | |
| error | back to summary |
|---|---|
| public void error(Throwable t) Close this source for now, but potentially reopen it later. Calling this
method asynchronously sends an error event to all connected consumers and
then disconnects them. Any events previously queued by the
After calling this method any
| |
| isConnected | back to summary |
|---|---|
| public boolean isConnected() Determine whether there are any
| |
| publish | back to summary |
|---|---|
| public void publish(T t) Asynchronously publish an event to this stream and all connected
| |