Constructor
new StreamManager(serverUrlnon-null, streamConfigurationnon-null, connectionHandlersnon-null, messageHandlersnon-null, optionsnon-null)
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 |
Description |
serverUrl |
string
|
The URL of the server to contact to request the creation of the new stream. |
streamConfiguration |
Object
|
The stream specification to be sent to the server. This includes
the configuration of each of the stream's channels, together with, optionally, the stream properties
object.
Properties
|
connectionHandlers |
Object
|
Callbacks for handling connection state changes.
Properties
|
messageHandlers |
Object
|
Callbacks for handling data received from the SSE stream.
Properties
|
options |
Object
|
Provides additional client-side configuration options.
Properties
Name |
Type |
Attributes |
Description |
streamTimeoutIntervalInSeconds |
number
|
<optional>
|
Periodicity with which the stream's heartbeat
message needs to be received before the manager will conclude that a communication outage has occurred. |
streamReconnectIntervalInSeconds |
number
|
<optional>
|
Period between successive reconnection
attempts following a communication outage. |
crossOriginCheckEnable |
boolean
|
<optional>
|
Whether this manager should perform a CORS check
to verify that the origin of the event stream is the same as the origin from which this manager
was loaded. |
asyncStreamDeleteEnable |
boolean
|
<optional>
|
Defines how this manager will send
stream delete requests to the wica stream server when the manager is shutdown. Set true to
enable the modern navigator.sendBeacon based approach. Set false to use a conventional
blocking HTTP DELETE approach. |
|
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: shutdown.
shutdown()
Shuts down this stream manager instance.
See also: activate.