Skip to content

Instantly share code, notes, and snippets.

@arisolt
Created January 27, 2013 06:13
Show Gist options
  • Save arisolt/4646837 to your computer and use it in GitHub Desktop.
Save arisolt/4646837 to your computer and use it in GitHub Desktop.
var kue = require('kue')
, jobs = kue.createQueue();
var sequence = 0;
setInterval(
function () {
sequence += 1;
(function(sequence) {
var job = jobs.create('email', {
title: 'Hello #' + sequence
, to: '[email protected]'
, body: 'Hello there'
}).save();
job.on('complete', function () {
console.log('job' + sequence + ' completed!')
});
})(sequence);
}
, 1000
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment