antirez / disque-module

Disque ported as Redis module
GNU Affero General Public License v3.0
477 stars 18 forks source link

Add QUEUECLEAR command #4

Open mvrhov opened 4 years ago

mvrhov commented 4 years ago

right now you have to list all the jobs in one queue and call DELJOB for each of them to celar jobs on one queue. This is cumbersome and takes a lot of time if there is a lot of jobs.

antirez commented 4 years ago

That's true. However Disque is a cluster so such a command should work in a way to make the queue deletion cluster-wide, at least if an additional option is specified (or omitted). Like:

DELQUEUE myqueue LOCAL # Only local queue deletion

DELQUEUE myqueue # Broadcast of a DELQUEUE message to all the reachable nodes

However such command would not be as resistant to failures as explicitly acknowledging all the jobs in a queue will be: in that case if nodes with a copy are unreachable, we'll wait to complete the GC.