Skip to main content

Interface: Subscription

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.

Hierarchy

Implemented by

Properties

canInitialNotify

Readonly canInitialNotify: boolean

Whether this subscription supports initial notifications on resume.

Defined in

src/sdk/sub/Subscription.ts:25


isAlive

Readonly isAlive: boolean

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.

Defined in

src/sdk/sub/Subscription.ts:14


isPaused

Readonly isPaused: boolean

Whether this subscription is paused. Paused subscriptions do not receive notifications from their sources until they are resumed.

Defined in

src/sdk/sub/Subscription.ts:20

Methods

destroy

destroy(): void

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

Defined in

src/sdk/sub/Subscription.ts:48


pause

pause(): this

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.

Defined in

src/sdk/sub/Subscription.ts:33


resume

resume(initialNotify?): this

Resumes this subscription. Once resumed, this subscription will receive notifications from its source.

Parameters

NameTypeDescription
initialNotify?booleanWhether 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.

Defined in

src/sdk/sub/Subscription.ts:42