- var kue = require('kue');
- var jobs = kue.createQueue();
- var i = 1;
- var jobInterval = setInterval(function(){
- console.log("creating job " + i + ".")
- jobs.create('test', {title:"This is a test", thing:"another thing.", id: i});
- i++;
- },2000);
- setTimeout(function(){
- clearInterval(jobInterval);
- },60000);
- jobs.process('test', function(job, done){
- console.log(job);
- done();
- });