-
Notifications
You must be signed in to change notification settings - Fork 47
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
Feature request: job priority #56
Comments
@KushalP Thanks for opening this issue! Yup, the idea sounds good. Shouldn't be too hard. We're going to need a migration since we have to add a column and either add/modify an index to cover priority. Would you like to take a crack at implementing this? |
Makes sense. How should the |
You asked for the feature... how would you like to use it? :) |
A field that could be overridden makes sense: |
Sounds great. Could be even better as a function:
This has two advantages:
|
…amsondav#56] This allows developers to define their own priorities for jobs.
…amsondav#56] This allows developers to define their own priorities for jobs.
…amsondav#56] This allows developers to define their own priorities for jobs.
Summary
All jobs are not created equal. Some need to be scheduled earlier than others if there aren't enough workers to work on all of the enqueued jobs. Allow defining a priority against all jobs to make sure that higher priority jobs are scheduled.
An example
You are running a subscription business and have two background jobs defined:
In this example you want to send the email to the customer to make sure they have feedback on the receipt of their subscription. This would take a higher priority over notifying a Slack channel.
Design idea
Create a column
priority (smallint/integer)
that allows defining an integer priority. This can conform to the niceness values used in Linux — lower values are more important. When trying to poll for jobs, order the result bypriority
.The text was updated successfully, but these errors were encountered: