Using nodejs and kue, I want to insert a long running job into a queue and forget about it. The worker will handle all details.
Short example:
(function(){
var kue = require('kue');
var jobs = kue.createQueue();
var job = jobs.create('email', {
foo: "bar"
}).save(function(err){
console.log("saved");
jobs.shutdown( function(err){
console.log("shutting down");
},0);
});
}());
// DOES NOT EXIT
The job is created (and processed separately) but the producers process does not exit without an interrupt signal.
I don't want the producer process to keep resources or connections open. I don't want to listen for job events. I'm hoping for a "fire and forget" type of approach.
Does kue do this? How?
Thanks!
EDIT:
1: To add: lsof -p shows open tcp connections to port 6379 (the redis server)
2: I also tried calling job.client.quit() in the shutdown callback.