resque-dynamic-queues
resque-dynamic-queues copied to clipboard
Respect the order in which queues/patterns are defined
The default Resque behavior is to respect the order in which queues are defined. Currently, resque-dynamic-queues
returns all matched queues sorted alphabetically. This might lead to confusing results.
Example
Existing queues:
- a_ext_high
- a_ext_medium
- a_ext_low
- a_int_high
- a_int_medium
- a_int_low
- b_int_high
- b_int_medium
- b_int_low
Resque::Worker.new(a_*_high, a_*_medium, a_*_low").queues
- Old queue order:
["a_ext_high", "a_ext_low", "a_ext_medium", "a_int_high", "a_int_low", "a_int_medium"]
- New queue order:
["a_ext_high", "a_int_high", "a_ext_medium", "a_int_medium", "a_ext_low", "a_int_low"]
Instead of returning matched queues sorted alphabetically, pre-sort all queues and keep the order in which patterns were defined.
@jfahrer My team was looking to fix this, so I merged this into our fork (https://github.com/BustedTees/resque-dynamic-queues). Think this repo is dead, given that a PR I opened fixing wildcards 4 years ago is still just sitting untouched. :)
Yes, sorry, I haven't touched resque in a long time. Happy to hand over maintenance to contributors if you'd like to be able to push gems, etc.