kue
kue copied to clipboard
Can a given worker delay or enqueue it's existing job and fetch a new job without calling done()?
I'd like to do something like this:
queue.process('email', 2, function(job, done){
if (other Concurrent Process is sending email from this user) {
delay this job and fetch a new job
} else {
do email sending here
}
});
Is it possible to have a worker do job.delay() then fetch a new job without calling done()?
Is it possible to have a worker do job.delay() then fetch a new job without calling done()?
No
your best chance is to fail a job that has been set with the corresponding delay on backoff, then you are simiulating that delay with the job retry delay, that sense good but delay feels to be set at the producer side not worker.
If this doesn't help you, you should change/alter you design in another terms to do what you need :)