Class: AsyncStream

AsyncStream

new AsyncStream()

A wrapper around the Stream class to use setTiemout and run stream "jobs" Asynchronously
Source:

Extends

Methods

dispose()

Destroys the stream and cleans up.
Inherited From:
Source:

off(type, listener) → {Boolean}

Remove a listener for a specified event type.
Parameters:
Name Type Description
type String the event name
listener function a function previously registered for this type of event through `on`
Inherited From:
Source:
Returns:
if we could turn it off or not
Type
Boolean

on(type, listener)

Add a listener for a specified event type.
Parameters:
Name Type Description
type String the event name
listener function the callback to be invoked when an event of the specified type occurs
Inherited From:
Source:

pipe(destination)

Forwards all `data` events on this stream to the destination stream. The destination stream should provide a method `push` to receive the data events as they arrive.
Parameters:
Name Type Description
destination Stream the stream that will receive all `data` events
Inherited From:
Source:
See:

push(job)

push a job into the stream
Parameters:
Name Type Description
job function the job to push into the stream
Source:

trigger(type)

Trigger an event of the specified type on this stream. Any additional arguments to this function are passed as parameters to event listeners.
Parameters:
Name Type Description
type String the event name
Inherited From:
Source: