Class: LongTermSubscription

ServerlessDb.LongTermSubscription

Instances of this class represent long term subscriptions to data events on data nodes of the Webcom ServerlessDb or ServerlessDbLite services. Long term subscriptions are managed and maintained by the Webcom back end, and still remain active when the client app terminates. They correspond to notifications over the ServerlessDb.Webhook channel.

Instances of this class are returned by the ServerlessDb.ServerlessDbNode#subscribe method when passed a ServerlessDb.Webhook channel, and the ServerlessDbLite.ServerlessDbLiteNode#subscribe method.

Since:
  • 3.5

Extends

Members

(readonly) childEventFilter :Object

[only for "childEvent" mode] A low-level object representing filtering criteria for child events.

Type:
  • Object

(readonly) context :string

The context associated with this subscription (should equal the context passed to the Webcom.Webhook factory).

Type:
  • string

(readonly) destination :string

The destination associated with this subscription (should equal the destination set up in the Webcom developer console).

Type:
  • string

(readonly) expirationDate :Date

The expiration date of this subscription.

Type:
  • Date

(readonly) id :string

The subscription id.

Type:
  • string

(readonly) kind :string

The kind of this subscription, should be "webhook".

Type:
  • string

(readonly) mode :string

The low-level event associated with this subscription, either "value" or "childEvent".

Type:
  • string

(readonly) path :string

The path related to this subscription.

Type:
  • string

Methods

cancel() → {Promise}

Cancels the subscription represented by this instance. This operation is asynchronous, it needs a request to the Webcom back end.

Overrides:
Returns:

The returned promise is resolved as soon as the cancelation of the subscription has been acknowledged by the Webcom back end.

Type
Promise

update(event) → {Promise.<ServerlessDb.LongTermSubscription>}

Updates the descriptor of data events watched by this subscription.

Parameters:
Name Type Description
event ServerlessDb.EventDescriptor

The new descriptor of data events this subscription watches.

Returns:

The returned promise is resolved as soon as the update of the subscription has been acknowledged by the Webcom back end.

Type
Promise.<ServerlessDb.LongTermSubscription>
show
deprecated