(require("cjs-async/parallel"))(tasks, callbackopt)
Parallel tasks execution.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
tasks |
Array.<module:cjs-async/parallel~taskHandler> | set of tasks to execute | |
callback |
module:cjs-async/parallel~onFinishCallback |
<optional> |
optional callback to run once all the tasks have completed |
- Source:
Example
parallel(taskList, function ( error, results ) {
console.log(error, results);
});
Type Definitions
onFinishCallback(error, result)
Method to be called on all given tasks completion.
Parameters:
Name | Type | Description |
---|---|---|
error |
boolean | status of all tasks execution |
result |
Array | data received from all tasks |
- Source:
onTaskFinishCallback(error, result)
Method to be called to set task as completed.
Parameters:
Name | Type | Description |
---|---|---|
error |
boolean | status of the task execution |
result |
Array | data to return from the task |
- Source:
taskHandler(callbackopt)
Task method to be executed.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
module:cjs-async/parallel~onTaskFinishCallback |
<optional> |
method to be called to set task as completed |
- Source:
Example
function ( callback ) {
callback(null, true);
}