This class sends membership changes for rooms in a linearized queue. The queue is lineaized based upon the hash value of the roomId, so that two operations for the same roomId may never happen concurrently.

Hierarchy

  • MembershipQueue

Constructors

Methods

  • Join a user to a room

    Returns

    A promise that resolves when the membership has completed

    Parameters

    • roomId: string

      The roomId to join

    • userId: undefined | string

      Leave empty to act as the bot user.

    • req: ThinRequest

      The request entry for logging context

    • retry: boolean = true

      Should the request retry if it fails

    • Optional ttl: number

      How long should this request remain queued in milliseconds before it's discarded. Defaults to opts.defaultTtlMs

    Returns Promise<void>

  • Leave OR kick a user from a room

    Returns

    A promise that resolves when the membership has completed

    Parameters

    • roomId: string

      The roomId to leave

    • userId: string

      Leave empty to act as the bot user.

    • req: ThinRequest

      The request entry for logging context

    • retry: boolean = true

      Should the request retry if it fails

    • Optional reason: string

      Reason for leaving/kicking

    • Optional kickUser: string

      The user to be kicked. If left blank, this will be a leave.

    • Optional ttl: number

      How long should this request remain queued in milliseconds before it's discarded. Defaults to opts.defaultTtlMs

    Returns Promise<void>

  • Parameters

    • item: QueueUserItem

    Returns Promise<void>

  • This should be called after starting the bridge in order to track metrics for the membership queue.

    Returns void

Generated using TypeDoc