Class SubscriptionManager

Hierarchy

  • SubscriptionManager

Constructors

Properties

#storage: Record<string, string[]> = {}

Methods

  • Either subscribes to or unsubscribes from given subtopics depending on action argument

    Parameters

    • input: SubscriptionManagerInput

      the topics and subtopics

    • action: "sub" | "unsub"

      determines if you need to subscribe or unsubscribe

    Returns Promise<undefined | MqttMessageOutgoing>[]

  • Sends signal to subscribe to all events from the #storage Intended to call after reconnect to easily restore all previous subscriptions

    Returns Promise<void>

  • Just saves the current subscriptions state in the RAM

    Parameters

    • topic: string
    • subs: string[]
    • action: "sub" | "unsub"

    Returns void