A WebsocketBuffer is used to store messages temporarily until they can be sent.

interface WebsocketBuffer<E = string | ArrayBufferLike | Blob | ArrayBufferView> {
    add(element: E): void;
    read(): undefined | E;
}

Type Parameters

  • E = string | ArrayBufferLike | Blob | ArrayBufferView

Methods

Methods

  • Adds an element to the buffer.

    Parameters

    • element: E

      the element to add

    Returns void

  • Reads an element from the buffer.

    Returns undefined | E

    an element from the buffer or undefined if the buffer is empty