Module: chopchop

chopchop

Methods

Off-load long running work of the main event loop by processing canonical filter in small batches.
This will keep the main event loop receptive, avoiding for example long-running script errors in the browser.

Returns:

Off-load long running work of the main event loop by processing canonical groupBy in small batches.
This will keep the main event loop receptive, avoiding for example long-running script errors in the browser.

Returns:

Off-load long running work of the main event loop by processing canonical map in small batches.
This will keep the main event loop receptive, avoiding for example long-running script errors in the browser.

Create pool from one or more handlers. When all handlers in the pool are busy, inputs will be queued until.
Typically, the handlers will be several instances of the same process.
(e.g. different instances of different workers)

Off-load long running work of the main event loop by processing canonical reduce in small batches.
This will keep the main event loop receptive, avoiding for example long-running script errors in the browser.

Returns:

Example

var h = cc.timeout;
cc
.series(cc.timeout,1,2,3)
.then(function(results){
//results is an array, containing 3 timestamps
//[0]: ~1 millisecond after the function was invoked
//[1]: ~3 milliseconds after the function was invoked (invoked when first was done)
//[2]: ~6 milliseconds after the function was invoked (invoked when second was done)
});

Creates a new function which will dispatch its input argument to the correct node, based on a partitioning function.
The partitioning or "hash" function evaluates the input argument, and returns a number which points to the node which should perform the work.
Typically, these nodes are handlers representing separate instances of the same worker.