Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 2nd, 2012  |  syntax: None  |  size: 0.38 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. var kue = require('kue');
  2. var jobs = kue.createQueue();
  3. var i = 1;
  4. var jobInterval = setInterval(function(){
  5.   console.log("creating job " + i + ".")
  6.   jobs.create('test', {title:"This is a test", thing:"another thing.", id: i});
  7.   i++;
  8. },2000);
  9. setTimeout(function(){
  10.   clearInterval(jobInterval);
  11. },60000);
  12.  
  13. jobs.process('test', function(job, done){
  14.   console.log(job);
  15.   done();
  16. });