queue3

Task (function) queue with concurrency / timeout control.

npm install queue3
23 downloads in the last month

queue

Task (function) queue with concurrency / timeout control.

Installation

$ npm install queue3

Example


var request = require('superagent');
var Queue = require('queue3');
var q = new Queue({ concurrency: 3, timeout: 3000 });

var urls = [
  'http://google.com',
  'http://yahoo.com',
  'http://ign.com',
  'http://msn.com',
  'http://hotmail.com',
  'http://cloudup.com',
  'http://learnboost.com'
];

urls.forEach(function(url){
  q.push(function(fn){
    console.log('%s', url);
    request.get(url, function(res){
      console.log('%s -> %s', url, res.status);
      fn();
    });
  });
});

License

MIT

npm loves you