limit-parallel
v1.0.1
Published
Limits the number of parallel functions being run and allows waiting for completion of all.
Downloads
3
Readme
limit-parallel
Installation
npm install limit-parallel
Usage
const LimitParallel=require('limit-parallel');
const limiter=new LimitParallel(10); //allows only 10 parallel tasks
for (let i=0;i<15;i++) {
await limiter.add(someFunctionThatReturnsAPromiseButResultsAreNotNeeded());
}
await limiter.finish(); //wait until all limiter functions are complete