RTCForge API Reference v1.1.1
    Preparing search index...

    Class SendQueue<T>

    Bounded FIFO MessageQueue used by WebSocketTransport to hold outbound messages while the socket is closed or reconnecting. Once capacity is reached, further SendQueue.enqueue calls are rejected rather than evicting existing messages, so the transport can surface a "queue full" error.

    Type Parameters

    • T

      The queued message type.

    Implements

    Index

    Constructors

    Accessors

    Methods

    Constructors

    Accessors

    Methods

    • Flushes the queue in FIFO order, invoking send for each message. The batch is spliced out up front (a single O(n) pass, no O(n²) shifting). If send throws, draining stops and the failed message plus every not-yet-sent message are re-queued ahead of any newly enqueued items so FIFO order is preserved; the exception is logged rather than propagated.

      Parameters

      • send: (item: T) => void

        Callback that transmits a single message.

      Returns void