A messaging bus for sending and receiving messages

Hierarchy

  • MessageBus

Implemented by

Methods

  • Publishes a message on a specified topic.

    Type Parameters

    • T

    Parameters

    • topic: string

      The topic on which the message will be sent.

    • message: T

      The message to be sent.

    • Optional options: MessageBusOptions

      Custom options for the message publish.

    Returns Promise<void>

  • Subscribe to messages sent to a specific topic.

    Returns

    Type Parameters

    • T

    Parameters

    • topic: string

      The topic on which the messages will be received.

    • listener: ((event: any, message: T) => void)

      Callback function for each message that is received.

        • (event: any, message: T): void
        • Parameters

          • event: any
          • message: T

          Returns void

    • Optional options: MessageBusOptions

      Custom options for subscription.

    Returns Promise<MessageBusSubscription>