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

Make Storage::Transaction a GAT #738

Merged
merged 1 commit into from
Aug 26, 2023
Merged

Make Storage::Transaction a GAT #738

merged 1 commit into from
Aug 26, 2023

Conversation

tillrohrmann
Copy link
Contributor

By making the Storage::Transaction a GAT, we can now create Transaction implementations which don't need to own their data, because the Transaction can borrow from Storage. For the current RocksDBTransaction implementation which internally uses spawn_blocking it does not make a difference.

This fixes #737.

Copy link
Contributor

@igalshilman igalshilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 of making the transaction borrow the storage.
I think that it now represents better the relationship between a transaction and the storage.
Even thinking forward for other implementations like PG etc' the transaction's life time needs to capture the storage lifetime.

LGTM!

By making the Storage::Transaction a GAT, we can now create
Transaction implementations which don't need to own their data,
because the Transaction can borrow from Storage.

This fixes #737.
@tillrohrmann tillrohrmann merged commit 355f35f into restatedev:main Aug 26, 2023
2 checks passed
@tillrohrmann tillrohrmann deleted the storage-lifetime branch August 26, 2023 15:39
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.

Make Storage::Transcation a GAT so that it can be implemented by borrowing Storage
2 participants