Caplin Trader 4.0.1

Class: module:caplin/sljsadapter/providers/StreamLinkSubscription

module:caplin/sljsadapter/providers/StreamLinkSubscription

Summary

The StreamLinkSubscription class provides a StreamLinkJS transport implementation of the module:caplin/services/messaging/Subscription interface. Constructs an instance of StreamLinkSubscription.

Constructor

new module:caplin/sljsadapter/providers/StreamLinkSubscription(oStreamLink, sSubject, oListener, mSubscriptionParameters)

if subject is undefined, null or empty
Parameters:
Name Type Description
oStreamLink caplin.streamlink.StreamLink The StreamLink that will provide the connection for this subscription.
sSubject String The data subject to which to subscribe. Required; non-empty.
oListener caplin.streamlink.SubscriptionListener The listener that will receive subscription events for this subscription.
mSubscriptionParameters Map A map of additional parameters for the subscription.
Implements:
Throws:
if subject is undefined, null or empty
Type
Error

Methods

dispose()

Permanently stops the subscription from receiving new updates to the subject. Should be called when there is no further need for this subscription.
Implements:
Throws:
if the subscription has already been disposed of.
Type
Error

getSubject()

Returns the subject that this subscription is subscribed to.
Implements:
Returns:
The subscribed subject.

isPaused()

Returns whether the subscription is currently paused or not.
Implements:
Throws:
if the subscription has been disposed of.
Type
Error

pause()

Temporarily disables the subscription from receiving new updates to the subject.
Implements:
Throws:
if the subscription has been disposed of.
Type
Error

resume()

Re-enables the subscription, allowing it to receive any new updates to the subject.
Implements:
Throws:
if the subscription has been disposed of.
Type
Error