antirez / disque

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

[Request] Unique Jobs #144

Closed Salakar closed 8 years ago

Salakar commented 8 years ago

Another request, sorry! :smiling_imp:

Would be good to be able to do unique jobs, so a UNIQUE arg on ADDJOB perhaps, that checks if the job already exists in the specified queue (and job is queued or currently working?) and if so doesn't create it. Or perhaps ADDJOBNX.

Thoughts?

Thanks, Mike

antirez commented 8 years ago

Hello, such feature is not planned since, most of the times re-delivery would create the same problem, and in general this problem is better solved by turning the job into an idempotent one. If instead the problem is avoid duplications of tasks at application level, I think it's up to the application data store to take the state. Can't see a good fit for this feature, but thanks for sharing it.