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

Change the RoTxn to support both WithTls and WithoutTls #290

Open
Kerollmops opened this issue Nov 30, 2024 · 0 comments
Open

Change the RoTxn to support both WithTls and WithoutTls #290

Kerollmops opened this issue Nov 30, 2024 · 0 comments
Labels
breaking A change that is breaking the semver enhancement New feature or request

Comments

@Kerollmops
Copy link
Member

Currently, all RoTxn created structs are Send if the read-txn-no-tls crate feature is set. This is not ideal because TLS-based RoTxn are less expensive and could be enabled by a dependency also depending on heed.

The best way to disable TLS would be to create two new unit structs: the WithTls and WithoutTls. The RoTxn would be parametric on it and become: RoTxn<WithoutTls> which makes it Send. We define this parameter when constructing it.

Unfortunately, the Env::read_txn method cannot use the default WithoutTls parameter as there are no default generics on methods in Rust, yet...

@Kerollmops Kerollmops added enhancement New feature or request breaking A change that is breaking the semver labels Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking A change that is breaking the semver enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant