I am using kue in one of my project to remove stale locks from the database. I am able to process individual jobs, like updating individual documents in mongoDB.
var kue = require('kue')
, queue = kue.createQueue();
queue.process('staleLocks', function(job, done){
removeLock(job.data.id, done);
});
function removeLock(id, done) {
// mongoDB call
done();
}
But, I want to update all the documents at once by collecting all the ids aftet the queue has been processed. I am able to even store all the ids. The only problem is that am not able to track, when the queue has been processed, some sort of event to synchronize the whole process.