0.0.3 • Published 9 years ago

throttleq v0.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

throttleq

Build Status

Limit the number of promises that can be simultaneously in flight.

Usage

var q = require('q');
var throttle = require('throttleq');

var promiseFactory = function() {
  ...
  return promise;
};

/* Takes promise returning function and number of simultaneously running
 * promises.
 */
var promiseThrottle = throttle(promiseFactory, 4);

q.all([
  promiseThrottle(args),
  ...
  promiseThrottle(args)
]);
0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

10 years ago