Simple ES6 Promises based queue, with optional (and flexible) concurrency.
promisqueue
can be installed using npm
:
npm install promisqueue
new PromisQueue(Object options): PromisQueue
PromisQueue#add(Function factory): Number
- adds function argument that generates a promise to the queue (FIFO)PromisQueue#prepend(Function factory): Number
- adds function argument that generates a promise to the queue (LIFO)
PromisQueue#length: Number
- returns current length of buffer(added but not started promise generators)PromisQueue#currentConcurrency: Number
- returns number of current concurrency limit