Skip to content

WebsocketBuffer

The WebsocketBuffer class manages a buffer for websocket data, allowing for data to be added incrementally and flushed when needed.

Properties

data

WebsocketBuffer.data  :: any

type

WebsocketBuffer.type  :: string

eventOutMiddleware

WebsocketBuffer.eventOutMiddleware  :: Network.EventOut

eventInMiddleware

WebsocketBuffer.eventInMiddleware  :: Network.EventIn

metadata

WebsocketBuffer.metadata  :: {
      {… headers: { [string]: string …}    }

data

WebsocketBuffer.data  :: string

Methods

flush

WebsocketBuffer : flush (

     self: WebsocketBuffer
)  -> string

Flushes the buffer, returning all accumulated data and resetting the buffer.

add

WebsocketBuffer : add (

     self: WebsocketBuffer
     data: string
)  -> ()

Adds data to the buffer.

Functions

new

WebsocketBuffer . new ()  -> ()

Creates a new instance of WebsocketBuffer.