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 internal "pilot" concept #627

Open
wants to merge 1 commit into
base: bg-remove-advisory-lock-unique-jobs
Choose a base branch
from

Conversation

bgentry
Copy link
Contributor

@bgentry bgentry commented Sep 29, 2024

This builds out a new higher level layer to sit between the Client and Driver, focused more on higher level operations than individual database queries. This allows those operations to be implemented with a combination of multiple database queries in a transaction, rather than just a single one.

Naming here was tough, I really didn't like any of the options I came up with and ultimately landed on "pilot", but I'm pretty indifferent to it if a truly good one can be found. I spent enough time trying to find a good one that I truly don't care at this point 😆

For now, the only operations implemented in the pilot are InsertMany and JobSetStateIfRunningMany (from the completer). I also made some changes within River to use these at the correct places and to propagate the pilot as needed. JobCompleteTx was updated to pull a Client out of the context in order to access this and use the same underlying query (via the pilot) as the BatchCompleter.

Based on #614 (including #624).

@bgentry bgentry force-pushed the bg-remove-advisory-lock-unique-jobs branch 2 times, most recently from 95d5825 to 6264e3f Compare September 30, 2024 22:58
This builds out a new higher level layer to sit between the Client and
Driver, focused more on higher level operations than individual database
queries. This allows those operations to be implemented with a
combination of multiple database queries in a transaction, rather than
just a single one.

Naming here was tough, I really didn't like any of the options I came up
with and ultimately landed on "pilot", but I'm pretty indifferent to it
if a truly good one can be found.

For now, the only operations implemented in the pilot are `InsertMany`
and `JobSetStateIfRunningMany` (from the completer). I also made some
changes within River to use these at the correct places and to propagate
the pilot as needed. `JobCompleteTx` was updated to pull a `Client` out
of the context in order to access this and use the same underlying query
(via the pilot) as the `BatchCompleter`.
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