Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect the order in which queues/patterns are defined #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jfahrer
Copy link

@jfahrer jfahrer commented Sep 4, 2018

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.

Instead of returning matched queues sorted alphabetically, pre-sort all
queues and keep the order in which patterns are defined.
@JoeMcB
Copy link

JoeMcB commented Apr 16, 2019

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

@wr0ngway
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants