batch-promise v1.0.0
Execute an array of promises in groups of predefined elements instead of all at once. If the group is 1, the execution will be synchronous.
Install
With npm do:
npm install batch-promise
Usage in npm
var batch = ;
parameters
- promiseFunc: the promise function. It will be executed with new Promise( promiseFunc ), so resolve & reject must be used to reach next promise group.
- size (optional): size of concurrent threads. If none, 1 will be applied.
return
- return : Returns a promise. It will be resolved when all promises will.
Example
var batch = ; var promises = ; // My promises will print a number at random delay -------// Build your own promise array ;)var foo = 0123456789;foo;//-------------------------------------------------------- console; ;
Release History
Date | Version | Comments |
---|---|---|
2016-05-31 | v1.0.0 | Initial version |
Submitted by Juan José Castaño