Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface SubscriptionManager

This is the interface for classes that represent a subscription manager. SubscriptionManager objects are used by the client to resubscribe and manage client subscriptions in case of a unintended disconnection. The default implementation is provided: DefaultSubscriptionManager.

Hierarchy

  • SubscriptionManager

Implemented by

Index

Methods

clear

  • clear(): void
  • This method clears all the managed subscriptions so that in case of the disconnection there will be no subscriptions to restore.

    Returns void

resubscribe

  • resubscribe(client: Client): void
  • This method resubscribes to all the stored subscriptions using the Client object provided.

    Parameters

    • client: Client

      The AMPS client object. It must be connected.

    Returns void

resubscriptionTimeout

  • resubscriptionTimeout(timeout?: number): number
  • This method sets/gets the resubscription timeout value. It should be bigger or equal to zero. If it is equal to zero, it never times out.

    Parameters

    • Optional timeout: number

      The timeout value (in milliseconds).

    Returns number

    The subscription timeout.

subscribe

  • subscribe(header: Header, messageHandler?: function): void
  • This method performs the subscription to a topic.

    Parameters

    • header: Header

      The subscription command header with all command data.

    • Optional messageHandler: function

      The message handler callback function. Not required in case of 'replace' or 'pause' subscriptions.

    Returns void

unsubscribe

  • unsubscribe(subId: string): void
  • This method unsubscribes from a topic using the subscription id.

    Parameters

    • subId: string

      The subscription id.

    Returns void