npm.io
1.0.3 • Published 9 years ago

promisqueue

Licence
MIT
Version
1.0.3
Deps
1
Vulns
0
Weekly
0
Stars
1

PromisQueue NPM Version Build Status

Simple ES6 Promises based queue, with optional (and flexible) concurrency.

Installation

promisqueue can be installed using npm:

npm install promisqueue

Interface

  • new PromisQueue(Object options): PromisQueue
Methods:
  • 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)
Properties:
  • PromisQueue#length: Number - returns current length of buffer(added but not started promise generators)
  • PromisQueue#currentConcurrency: Number - returns number of current concurrency limit

Keywords