websocket-ts
    Preparing search index...

    Interface WebsocketBuffer<E>

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

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

    Type Parameters

    • E = string | Blob | BufferSource
    Index
    • Adds an element to the buffer.

      Parameters

      • element: E

        the element to add

      Returns void

    • Reads an element from the buffer.

      Returns E | undefined

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