All Projects → tj → Node Queue3

tj / Node Queue3

another queue module, with timeouts just in case you miss a callback ;)

Programming Languages

javascript
184084 projects - #8 most used programming language

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].