resque-dynamic-queues icon indicating copy to clipboard operation
resque-dynamic-queues copied to clipboard

Respect the order in which queues/patterns are defined

Open jfahrer opened this issue 6 years ago • 2 comments

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 avatar Sep 04 '18 19:09 jfahrer

@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. :)

JoeMcB avatar Apr 16 '19 19:04 JoeMcB

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.

wr0ngway avatar Apr 16 '19 20:04 wr0ngway