parallel-stream
Transform and writable streams capable of processing chunks concurrently.
Usage
transform
A concurrent transform stream
Parameters
work
function a function to process a single chunk. Function signature should beprocess(chunk, enc, callback)
. When finished processing, fire the providedcallback
.options
object options to pass to the transform stream. (optional, defaultundefined
)options.concurrency
number number of chunks to process concurrently. (optional, default1
)
Examples
var parallel = ; var transform = parallel; readable ;
Returns object a transform stream. Do not override the ._transform
function.
writable
A concurrent writable stream
Parameters
work
function a function to process a single chunk. Function signature should beprocess(chunk, enc, callback)
. When finished processing, fire the providedcallback
.flush
function a function to run once all chunks have been processed, but before the stream emits afinished
event. Function signature should beflush(callback)
, fire the providedcallback
when complete. (optional, defaultundefined
)options
object options to pass to the writable stream. (optional, defaultundefined
)options.concurrency
number number of chunks to process concurrently. (optional, default1
)
Examples
var parallel = ; var writable = parallel; readable ;
Returns object a writable stream. Do not override the ._write
function.