Constructor
new StreamManager(serverUrl, streamConfiguration, connectionHandlers, messageHandlers, optionsopt)
Constructs a new instance.
The returned object will remain in a dormant state until triggered by a call to the activate method.
Parameters:
| Name |
Type |
Attributes |
Description |
serverUrl |
string
|
|
The URL of the server that will create the new stream. |
streamConfiguration |
Object
|
|
The stream specification sent to the server, including channel
configurations and optional stream properties.
Properties
|
connectionHandlers |
Object
|
|
Callback functions for handling connection state changes.
Properties
|
messageHandlers |
Object
|
|
Callbacks for handling SSE data messages.
Properties
|
options |
Object
|
<optional>
|
Optional client-side configuration.
Properties
| Name |
Type |
Attributes |
Description |
streamTimeoutIntervalInSeconds |
number
|
<optional>
|
Maximum permitted interval between heartbeat messages. |
streamReconnectIntervalInSeconds |
number
|
<optional>
|
Delay between reconnect attempts after an outage. |
crossOriginCheckEnable |
boolean
|
<optional>
|
Whether CORS origin checks should be performed. |
asyncStreamDeleteEnable |
boolean
|
<optional>
|
Whether to delete the stream using navigator.sendBeacon
(true) or a blocking HTTP DELETE request (false). |
|
Methods
activate()
Activates this stream manager instance.
More specifically this sets up a state machine to create and manage an active event stream
and for calling other handlers as required to track the evolving connection state and received
data.
See also: module:stream-manager.StreamManager#shutdown.
shutdown()
Shuts down this stream manager instance.
See also: module:stream-manager.StreamManager#activate.