jeudi 2 avril 2015

Node.js Kue - Pause workers in app with multiple instances

When using kue in an app that has multiple instances (say multiple containers in docker) that all use the same redis database, if you pause a worker, do you need to pause that worker on all instances or is that handled at the redis level and hence handled for you?


http://ift.tt/1xTpaoj



queue.process('email', function(job, ctx, done){
ctx.pause( 5000, function(err){
console.log("Worker is paused... ");
setTimeout( function(){ ctx.resume(); }, 10000 );
});
});


It'd be great if we didn't have to use any instance-to-instance communication to get all workers to pause.


Aucun commentaire:

Enregistrer un commentaire