matrix-js-sdk
    Preparing search index...

    Class StickyEventSendQueue

    Ensures sticky events with the same room, event type and sticky key are sent in the order they were queued and at least 1 millisecond apart. Otherwise both events could get the same origin_server_ts which would make them tie break on event ID in the ephemeral sticky map.

    Index
    • Queues a send behind earlier sends with the same room, event type and sticky key.

      Call this before doing anything asynchronous, so that concurrent sends go out in the order they were queued.

      Type Parameters

      • T

      Parameters

      • roomId: string

        The room the event is sent to.

      • eventType: string

        The type of the event.

      • stickyKey: string | undefined

        The sticky key of the event. Events without a sticky key are sent right away.

      • send: () => Promise<T>

        Sends the event.

      Returns Promise<T>

      The result of send.