Interface for receiving updates to subscribed data from the Liberator.
Your application should implement this interface.
A trivial implementation of SubscriptionListener
would be:
// every possible callback.
//
// This trivial implementation just logs the update event
// for each type of data that can be received.
//
streamLink.subscribe("/SUBJECT", {
onSubscriptionStatus: function(subscription, event) {
console.log(event);
},
onSubscriptionError: function(subscription, event) {
console.log(event);
},
onStoryUpdate: function(subscription, event) {
console.log(event);
},
onRecordUpdate: function(subscription, event) {
console.log(event);
},
onRecordType2Update: function(subscription, event) {
console.log(event);
},
onRecordType3Update: function(subscription, event) {
console.log(event);
},
onPermissionUpdate: function(subscription, event) {
console.log(event);
},
onNewsUpdate: function(subscription, event) {
console.log(event);
},
onDirectoryUpdate: function(subscription, event) {
console.log(event);
},
onContainerUpdate: function(subscription, event) {
console.log(event);
},
onChatUpdate: function(subscription, event) {
console.log(event);
},
onPageUpdate: function(subscription, event) {
console.log(event);
}
}, null);
Attributes | Name and Description |
---|---|
|
caplin.streamlink.SubscriptionListener()
|
Attributes | Name and Description |
---|---|
|
void
onChatUpdate( subscription, evt)
* Called when a chat update is received. |
|
void
onContainerUpdate( subscription, evt)
* Called when a container update is received. |
|
void
onDirectoryUpdate( subscription, evt)
* Called when a directory update is received. |
|
void
onNewsUpdate( subscription, evt)
* Called when a news headline update is received. |
|
void
onPageUpdate( subscription, evt)
* Called when a page update is received. |
|
void
onPermissionUpdate( subscription, evt)
* Called when a permission update is received. |
|
void
onRecordType2Update( subscription, evt)
* Called when an update to type 2 data in a record is received. |
|
void
onRecordType3Update( subscription, evt)
* Called when an update to type 3 data in a record is received. |
|
void
onRecordUpdate( subscription, evt)
* Called when an update to type 1 data in a record is received. |
|
void
onStoryUpdate( subscription, evt)
* Called when a news story update is received. |
|
void
onSubscriptionError( subscription, evt)
* Called when there is an error in a subscription. |
|
void
onSubscriptionStatus( subscription, evt)
* Called when there is a change in the status of a subscription. |
►
caplin.streamlink.SubscriptionListener()
►
void
onChatUpdate( subscription, evt)
*
Called when a chat update is received. Implementing this method is optional.
*@param {caplin.streamlink.Subscription} subscription The subscription for which the update occurred. *@param {caplin.streamlink.ChatEvent} evt The chat update.subscription | ||
evt |
►
void
onContainerUpdate( subscription, evt)
*
Called when a container update is received. Implementing this method is optional.
*@param {caplin.streamlink.Subscription} subscription The subscription for which the update occurred. *@param {caplin.streamlink.ContainerEvent} evt The container update.subscription | ||
evt |
►
void
onDirectoryUpdate( subscription, evt)
*
Called when a directory update is received. Implementing this method is optional.
*@param {caplin.streamlink.Subscription} subscription The subscription for which the update occurred. *@param {caplin.streamlink.DirectoryEvent} evt The directory update.subscription | ||
evt |
►
void
onNewsUpdate( subscription, evt)
*
Called when a news headline update is received. Implementing this method is optional.
*@param {caplin.streamlink.Subscription} subscription The subscription for which the update occurred. *@param {caplin.streamlink.NewsEvent} evt The news headline update.subscription | ||
evt |
►
void
onPageUpdate( subscription, evt)
*
Called when a page update is received. Implementing this method is optional.
*@param {caplin.streamlink.Subscription} subscription The subscription for which the update occurred. *@param {caplin.streamlink.PageEvent} evt The page update.subscription | ||
evt |
►
void
onPermissionUpdate( subscription, evt)
*
Called when a permission update is received. Implementing this method is optional.
*@param {caplin.streamlink.Subscription} subscription The subscription for which the update occurred. *@param {caplin.streamlink.PermissionEvent} evt The permission update.subscription | ||
evt |
►
void
onRecordType2Update( subscription, evt)
*
Called when an update to type 2 data in a record is received. Implementing this method is optional.
*@param {caplin.streamlink.Subscription} subscription The subscription for which the update occurred. *@param {caplin.streamlink.RecordType2Event} evt The record update.subscription | ||
evt |
►
void
onRecordType3Update( subscription, evt)
*
Called when an update to type 3 data in a record is received. Implementing this method is optional.
*@param {caplin.streamlink.Subscription} subscription The subscription for which the update occurred. *@param {caplin.streamlink.RecordType3Event} evt The record update.subscription | ||
evt |
►
void
onRecordUpdate( subscription, evt)
*
Called when an update to type 1 data in a record is received. Implementing this method is optional.
*@param {caplin.streamlink.Subscription} subscription The subscription for which the update occurred. *@param {caplin.streamlink.RecordType1Event} evt The record update.subscription | ||
evt |
►
void
onStoryUpdate( subscription, evt)
*
Called when a news story update is received. Implementing this method is optional.
*@param {caplin.streamlink.Subscription} subscription The subscription for which the update occurred. *@param {caplin.streamlink.StoryEvent} evt The news story update.subscription | ||
evt |
►
void
onSubscriptionError( subscription, evt)
*
Called when there is an error in a subscription.
* *This callback being invoked is a final state for the subscription and * no further callbacks will be received for it.
* *@param {caplin.streamlink.Subscription} subscription The subscription for which the error occurred. *@param {caplin.streamlink.SubscriptionErrorEvent} evt The subscription error event.subscription | ||
evt |
►
void
onSubscriptionStatus( subscription, evt)
*
Called when there is a change in the status of a subscription.
*@param {caplin.streamlink.Subscription} subscription The subscription for which the update occurred. *@param {caplin.streamlink.SubscriptionStatusEvent} evt The subscription status event.subscription | ||
evt |