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

Scheduler refactor: move transaction create/commit/rollback/retry up into scheduler? #27

Closed
rdaum opened this issue Sep 25, 2023 · 1 comment

Comments

@rdaum
Copy link
Owner

rdaum commented Sep 25, 2023

Right now it's task.rs that does the logic with this.

With the command interpreter loop there's 2 separate transactions: one to match for parsing the command, and another to execute the command. And with support for $do_command there's a third, and once I fix missing huh handling, that's a fourth! Not a good situation. 3/4 of these transactions all occur within the scheduler, and so could be all subsumed under that one place.

I played with optionally passing an already-existing transaction into the task, but the problem with this is that to do the :huh support the transaction will already have been committed when the task completes with error.

So my proposal is to go through and clean things up potentially so that tasks always begin and end with an open transaction, and it's Scheduler that is responsible for the lifecycle of transactions -- passing ownership of them to the task, and getting them back again at completion.

@rdaum
Copy link
Owner Author

rdaum commented Sep 25, 2023

Decided to do the opposite and push more down into the task.

@rdaum rdaum closed this as completed Sep 25, 2023
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

No branches or pull requests

1 participant