antirez / disque

Disque is a distributed message broker
BSD 3-Clause "New" or "Revised" License
8.01k stars 538 forks source link

[Request] NACK with a delay #170

Open Revisor opened 8 years ago

Revisor commented 8 years ago

Hi, I'd like to implement retry with an exponential backoff as used in Sidekiq, that is if a job fails it is requeued with an ever longer pause.

Right now if I NACK a job, it returns to the queue immediately. My other option is to ACK the job and add it again, with a delay. This works OK, but from client's point of view it changes the job ID and that makes tracking failed jobs more difficult.

The NACK command with a delay support could look like this:

NACK <job-id> ... <job-id> [DELAY <sec>]

What do you think?

mtdavidson commented 8 years ago

+1 I thought exactly this. Just being able to adjust the delay on the job without recreating it would be good, but I suppose their are issues related to if its been propagated out to other nodes for processing.

locked commented 8 years ago

+1 would be very nice indeed to have the [DELAY ] argument added to the NACK command

withings-sas commented 8 years ago

Pull request #188 implements this

Revisor commented 8 years ago

Nice, thank you.