Broker defines a struct for managing subscriptions clients.

Hierarchy

  • Broker

Methods

  • ChunkedClients splits the current clients into a chunked slice.

    Parameters

    • chunkSize: number

    Returns Client[][]

  • ClientById finds a registered client by its id.

    Returns non-nil error when client with clientId is not registered.

    Parameters

    • clientId: string

    Returns Client

  • Register adds a new client to the broker instance.

    Parameters

    Returns void

  • TotalClients returns the total number of registered clients.

    Returns number

  • Unregister removes a single client by its id and marks it as discarded.

    If client with clientId doesn't exist, this method does nothing.

    Parameters

    • clientId: string

    Returns void

Generated using TypeDoc