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

refactor scheduler #33

Merged
merged 1 commit into from
Oct 26, 2024
Merged

refactor scheduler #33

merged 1 commit into from
Oct 26, 2024

Conversation

maxcountryman
Copy link
Owner

This refactors the scheduler to be more like the worker: e.g. it now manages a cancellation token and uses it to manage the shutdown state.

Again similarly to the worker, it listens on the same shutdown channel and upon a notify from postgres will cancel its cancellation token thereby stopping the scheduler.

Coupled with these changes is a breaking change to the queue interface: instead of taking ownership of input, enqueue takes a reference. A similar change should be made for the schedule methods, but that is left out of this patch intentionally.

This refactors the scheduler to be more like the worker: e.g. it now
manages a cancellation token and uses it to manage the shutdown state.

Again similarly to the worker, it listens on the same shutdown channel
and upon a notify from postgres will cancel its cancellation token
thereby stopping the scheduler.

Coupled with these changes is a breaking change to the queue interface:
instead of taking ownership of input, enqueue takes a reference. A
similar change should be made for the schedule methods, but that is left
out of this patch intentionally.
@maxcountryman maxcountryman merged commit 6df1f0e into main Oct 26, 2024
4 checks passed
@maxcountryman maxcountryman deleted the scheduler-refactor branch October 26, 2024 14:31
maxcountryman added a commit that referenced this pull request Oct 26, 2024
This is a follow up to the enqueue changes in #33.
maxcountryman added a commit that referenced this pull request Oct 26, 2024
This is a follow up to the enqueue changes in #33.
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.

1 participant