Skip to content

Instantly share code, notes, and snippets.

@dreadjr
Created January 31, 2013 23:57
Show Gist options
  • Save dreadjr/4687855 to your computer and use it in GitHub Desktop.
Save dreadjr/4687855 to your computer and use it in GitHub Desktop.
var TimeQueue = require('timequeue');
var n = 0;
function worker(callback) {
console.log('request'+(n++));
callback(null, 'good');
}
var x = 0;
console.log('0 minute');
setInterval(function() {
console.log((++x)+' minute');
}, 60000);
var q = new TimeQueue(worker, { concurrency: 5, every: 60000 });
setInterval(function() {
q.push();
}, 100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment