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

Workers with wildcard queue will find new queues #413

Merged
merged 1 commit into from
Aug 6, 2020

Conversation

evantahler
Copy link
Member

If worker.queues = ['*'], this PR adds functionality to re-scan the list of queues that exist before every worker#sleep. In this way, if the worker has no jobs to perform in the queues it knows about, it will check for new queues.

closes #412

@evantahler evantahler mentioned this pull request Aug 6, 2020
@evantahler evantahler merged commit a0d8078 into master Aug 6, 2020
@evantahler evantahler deleted the find-new-queues-with-wildcard branch August 6, 2020 01:09
if (!this.running) {
return;
}
if (!this.running) return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my personal preference is never to do such single line code "optimizations":

  1. ...
  2. using consistent style
  3. inexperienced developer may be adding extra code that they think is grouped by condition but really is just standalone statement
-    if (!this.running) return;
+    if (!this.running) console.log("running"); return;

@glensc
Copy link
Contributor

glensc commented Aug 6, 2020

I think the documentation should be updated, that there are some drawbacks using "*" queue:

  • minor performance impact for checking the queues
  • undefined order of queues

@evantahler
Copy link
Member Author

I think the documentation should be updated, that there are some drawbacks using "*" queue:

  • minor performance impact for checking the queues

  • undefined order of queues

Awesome! Please submit a pull request with that language!

@glensc
Copy link
Contributor

glensc commented Aug 7, 2020

this should have been minor version not patch version according to semver.

@evantahler
Copy link
Member Author

Interesting! I view this as a bug that was fixed. Folks assumed that * would find new queues, yourself included. Aren't bugfixes to be patches?

@glensc
Copy link
Contributor

glensc commented Aug 8, 2020

Seems to me a new feature that "*" would pick up new queues without restarting application :)

also, I never used this feature, I stumbled on it when doing code-review of this project.

@glensc
Copy link
Contributor

glensc commented Aug 16, 2020

#420

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.

Queues: "*" bug
2 participants