Skip to content

Instantly share code, notes, and snippets.

@arisolt
Created February 5, 2013 13:41
Show Gist options
  • Save arisolt/4714520 to your computer and use it in GitHub Desktop.
Save arisolt/4714520 to your computer and use it in GitHub Desktop.
var request = require('request'),
async = require('async'),
kue = require('kue'),
jobs = kue.createQueue();
function main (job, done) {
async.series(
[function (callback) {
request({url: job.data.URL}, function (err, resp, body) {
//stuff...
callback(err);
});
},
function (callback) {
//stuff...
callback();
}
],
function (err) {
//stuff...
done();
}
);
}
jobs.process('job_name', function (job, done) {
main (job, done);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment