-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add priority queue support #38
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #38 +/- ##
==========================================
+ Coverage 91.11% 91.85% +0.74%
==========================================
Files 25 27 +2
Lines 855 1007 +152
Branches 115 93 -22
==========================================
+ Hits 779 925 +146
- Misses 45 50 +5
- Partials 31 32 +1 ☔ View full report in Codecov by Sentry. |
a172a97
to
6b5e448
Compare
54e7990
to
3600318
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks straightforward 💯
my initial though would've been to keep the public API more or less the same with the priority queues
not highly against the approach, but looking forward to the discussion and if it leads to any changes 😆
thank you for the reviews, updated sources |
@@ -81,7 +81,7 @@ jobs: | |||
- run: pip install build twine | |||
- run: python -m build . | |||
- run: twine check dist/* | |||
- uses: actions/upload-artifact@v3 | |||
- uses: actions/upload-artifact@v4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sneaky sneak
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
required for the CIs to pass
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
excited to see it in action!
Use the power of Redis Lua scripting to implement priority queueing by sorting the queue list for each job priority.
While this approach has its limits if the queue is very long, as each insert iterates the entire queue at most twice, it is fully compatible with existing queue consumers who don't need to know about job priorities.