Class: Stream

Stream()

A dead simple readable and writable object stream. Really a queue, but I don't bother renaming it

Constructor

new Stream()

Creates a new stream
Source:

Members

length :Integer

Number of objects waiting to be read from the stream
Type:
  • Integer
Source:

(readonly) snapshot :Array.<Object>

A snapshot of the stream's internal buffer
Type:
  • Array.<Object>
Source:

Methods

read() → {Object}

Reads an object from the stream
Source:
Throws:
If the stream is empty
Type
Error
Returns:
The next object in the stream
Type
Object

write(obj)

Writes an object to the stream
Parameters:
Name Type Description
obj Object The object to write
Source: