A TriggerService subscribes to the Triggers of a StreamLink user and allows the user to register a listener to be called back when triggers are added, removed or modified.
The service itself does not subscribe to anything unless listeners are added to it. For every listener added one subscription is being issued. These subscriptions induce the service state for the associated listeners. Therefore the service states can vary for different listeners. If the reference to the service is removed without removing all listeners beforehand, open subscriptions will stay around forever. To avoid that, remove all listeners before removing the service.
Attributes | Name and Description |
---|---|
|
caplin.streamlink.alerts.TriggerService()
|
Attributes | Name and Description |
---|---|
|
void
addListener( listener)
Adds a trigger listener that will be called back when triggers are added and removed. |
|
void
addTrigger( subject, condition, extraParams, listener)
Add a new trigger for the current user. |
|
void
removeListener( listener)
Removes a previously added trigger listener, callbacks to this listener will be stopped. |
|
void
removeTrigger( trigger, listener)
Removes a trigger from the system. |
►
caplin.streamlink.alerts.TriggerService()
►
void
addListener( listener)
Adds a trigger listener that will be called back when triggers are added and removed.
listener | - The TriggerListener to be added. |
►
void
addTrigger( subject, condition, extraParams, listener)
Add a new trigger for the current user.
subject | the rttp subject of this trigger. | |
condition | the trigger condition, for more details on the format of the condition string, please see the StreamLink Overview document. | |
extraParams | a map of extra parameters to be added to the trigger. | |
listener | a ResultListener that will be called back to notify the user code of the result of this operation. |
►
void
removeListener( listener)
Removes a previously added trigger listener, callbacks to this listener will be stopped.
listener | - The TriggerListener to be removed. |
►
void
removeTrigger( trigger, listener)
Removes a trigger from the system.
trigger | the Trigger that should be removed. | |
listener | a ResultListener that will be called back to notify the user code of the result of this operation. |