Interface: Subscription
Defined in: src/sdk/sub/Subscription.ts:9
A subscription to a source of notifications.
Subscriptions can be freely paused and resumed. Paused subscriptions do not receive notifications from its source.
Subscriptions that have reached the end of their useful life can be destroyed, after which they will no longer receive notifications and cannot be paused or resumed.
Extended by
Properties
canInitialNotify
readonly
canInitialNotify:boolean
Defined in: src/sdk/sub/Subscription.ts:25
Whether this subscription supports initial notifications on resume.
isAlive
readonly
isAlive:boolean
Defined in: src/sdk/sub/Subscription.ts:14
Whether this subscription is alive. Live subscriptions can be freely paused and resumed. Dead subscriptions no longer receive notifications from their sources and will throw an error when attempting to pause or resume them.
isPaused
readonly
isPaused:boolean
Defined in: src/sdk/sub/Subscription.ts:20
Whether this subscription is paused. Paused subscriptions do not receive notifications from their sources until they are resumed.
Methods
destroy()
destroy():
void
Defined in: src/sdk/sub/Subscription.ts:48
Destroys this subscription. Once destroyed, this subscription will no longer receive notifications from its source and will throw an error when attempting to pause or resume it.
Returns
void
pause()
pause():
this
Defined in: src/sdk/sub/Subscription.ts:33
Pauses this subscription. Once paused, this subscription will not receive notifications from its source until it is resumed.
Returns
this
This subscription, after it has been paused.
Throws
Error if this subscription is not alive.
resume()
resume(
initialNotify?
):this
Defined in: src/sdk/sub/Subscription.ts:42
Resumes this subscription. Once resumed, this subscription will receive notifications from its source.
Parameters
Parameter | Type | Description |
---|---|---|
initialNotify? | boolean | Whether to immediately send a notification to this subscription's handler when it is resumed if this subscription supports initial notifications. Defaults to false . |
Returns
this
This subscription, after it has been resumed.
Throws
Error if this subscription is not alive.