Promise Queue Pool
Install
npm install --save promise-pool2
Docs
-
constructor(capacity) - accepts
capacity
the maximum number of promises that can be executed at every moment -
.add(fn) - accepts function with no arguments, which returns promise object that must be executed later.
add
method returns newPromise
which will be resolved/rejected later
Usage
const PromisePool = ;const pool = 3; // maximum 3 promises can be executed at every moment Promiseall pool pool pool pool pool pool pool pool ; { return { ; };} { console; return txt;}