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

libsql: refactor push and sync code #1827

Merged
merged 5 commits into from
Nov 19, 2024
Merged

Conversation

LucioFranco
Copy link
Contributor

This PR has multiple commits each broken up into their own refactor piece. Broken down is the list of refactors and why:

  • Move sync ctx behind a mutex, this in general makes sense since we only want one push to be active at a time but also will enable the future durable_frame_no caching by allow us to mutate the struct on push. It is an async lock since we want to sync access to push over long async periods.
  • move push_with_retry into sync.rs
  • move push_one_frame into sync.rs these both make sense since the data they depend on is inside the sync_ctx struct so this allows us to make those fields private.
  • Following up on those two, the next commit makes those fields private to improve code encapsulation.
  • Small refactor now to use the auth_token field from the struct.

This PR just moves some code around but doesn't actually touch any of the logic in the code.

@LucioFranco LucioFranco changed the title Lucio/refactor sync ctx libsql: refactor push and sync code Nov 18, 2024
@LucioFranco LucioFranco force-pushed the lucio/refactor-sync-ctx branch from 390240b to 56f5f4b Compare November 19, 2024 13:49
@LucioFranco LucioFranco force-pushed the lucio/refactor-sync-ctx branch from 56f5f4b to 5023ebc Compare November 19, 2024 13:57
@LucioFranco
Copy link
Contributor Author

Last commit contains a bit more since for some reason an old hyper commit got layered into the commit range.

@LucioFranco
Copy link
Contributor Author

Should now not contain any hyper changes and should just be a refactor of the old functions.

@LucioFranco LucioFranco force-pushed the lucio/refactor-sync-ctx branch from 5023ebc to 4887753 Compare November 19, 2024 14:13
@LucioFranco LucioFranco added this pull request to the merge queue Nov 19, 2024
Merged via the queue into main with commit 240eee8 Nov 19, 2024
18 checks passed
@LucioFranco LucioFranco deleted the lucio/refactor-sync-ctx branch November 19, 2024 15:05
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.

2 participants