throttleq

0.0.3 • Public • Published

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)
]);
 

Readme

Keywords

Package Sidebar

Install

npm i throttleq

Weekly Downloads

0

Version

0.0.3

License

MIT

Last publish

Collaborators

  • yola-readonly
  • yola-engineers