Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Channel

Hierarchy

  • Channel

Index

Constructors

Properties

Methods

Constructors

constructor

constructor:

Properties

id

id: number

The channel's id, this is supplied to us by the container

status

status: "open" | "closed" | "closing"

The current connection status of the channel. When the channel is open or closing you can potentially receive commands on the channel. You can only send to the channel when it's open

Methods

onCommand

  • onCommand(listener: (cmd: Command) => void): () => void
  • To listen to commands received by this channel, supply a a callback to this function and the callback will be called any time we receive a command on this channel.

    Parameters

    • listener: (cmd: Command) => void

      the command listener

    Returns () => void

    a function to stop listening

      • (): void
      • Returns void

request

  • Sends a command on the channel and returns a promise that is resolved when we get a response.

    Be ware, not all messages can have a result, so the promise might never resolve.

    Parameters

    Returns Promise<RequestResult>

send

Generated using TypeDoc