# Class: AsyncStream

## AsyncStream

#### new AsyncStream()

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

Source:
  - decrypter/async-stream.js, line 6

### Extends

- Stream

### Methods

#### dispose()

Destroys the stream and cleans up.

Inherited From:
  - Stream#dispose
Source:
  - stream.js, line 84

#### 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:
  - Stream#off
Source:
  - stream.js, line 36

##### 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:
  - Stream#on
Source:
  - stream.js, line 21

#### 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:
  - Stream#pipe
Source:
  - stream.js, line 95
See:
  - http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options

#### push(job)

push a job into the stream

##### Parameters:

Name | Type | Description
--- | --- | ---
`job` | function | the job to push into the stream

Source:
  - decrypter/async-stream.js, line 41

#### 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:
  - Stream#trigger
Source:
  - stream.js, line 53