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

Add support for task priorities #7

Closed
prabirshrestha opened this issue Sep 3, 2022 · 1 comment · Fixed by #10
Closed

Add support for task priorities #7

prabirshrestha opened this issue Sep 3, 2022 · 1 comment · Fixed by #10
Labels
enhancement New feature or request

Comments

@prabirshrestha
Copy link

Some urgent task would need to be schedule earlier than existing one. Allowing us to pass priority as a number would allow us to enable this scenario.

@andoriyu
Copy link
Collaborator

@prabirshrestha Technically this is already supported, but on task type level. We are still going to add priority, this I am breaking change since public interface going to change.

Meanwhile, to achieve this, you can create a separate Queue that only works with your priority task types. Pair it with a new JobRunner and now you have a worker that only process your priority tasks.

Additionally, you can schedule tasks in the past, "I need this done yesterday" will have the same effect on scheduling as on people.

This solution has a downside that if priority worker and regular worker run on the same machine - both have their own concurrency and no way to communicate.

@andoriyu andoriyu added the enhancement New feature or request label Sep 26, 2022
andoriyu added a commit that referenced this issue Oct 15, 2022
Allows specifying priority when job is enqueued.

Closes #7

BREAKING CHANGE:

 - `SCHEMA_SQL` is gone. `MIGRATOR` should be used instead. This means
   ADC must have exclusive rights to SQLx migrations table. Since it's
   rarely the case - use different schema/database for ADC.
 - Interface to Queue for pushing jobs includes `priority` argument
andoriyu added a commit that referenced this issue Oct 15, 2022
Allows specifying priority when job is enqueued.

Closes #7

BREAKING CHANGE:

 - `SCHEMA_SQL` is gone. `MIGRATOR` should be used instead. This means
   ADC must have exclusive rights to SQLx migrations table. Since it's
   rarely the case - use different schema/database for ADC.
 - Interface to Queue for pushing jobs includes `priority` argument
andoriyu added a commit that referenced this issue Oct 15, 2022
Allows specifying priority when job is enqueued.

Closes #7

BREAKING CHANGE:

 - `SCHEMA_SQL` is gone. `MIGRATOR` should be used instead. This means
   ADC must have exclusive rights to SQLx migrations table. Since it's
   rarely the case - use different schema/database for ADC.
 - Interface to Queue for pushing jobs includes `priority` argument
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants