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

std::sync::RwLock and tokio runtime #164

Open
borispovod opened this issue Sep 7, 2023 · 0 comments
Open

std::sync::RwLock and tokio runtime #164

borispovod opened this issue Sep 7, 2023 · 0 comments

Comments

@borispovod
Copy link
Contributor

Hey,

I noticed that the std::sync::RwLock being used for the state in the driver might pose some challenges in the future. The RwLock from the standard library is synchronous and has the potential to block the entire runtime, similar to what was observed with the channel in L1.

At the moment, this isn't causing any issues, likely because the batch processing is going step by step. However, as the system evolves, this might lead to complications.

It might be worth considering replacing the standard RwLock with its asynchronous counterpart from tokio. If this route is taken, read/write operations for the state would also need to be made asynchronous. This would entail a significant refactoring effort in derive to use asynchronous constructs, such as replacing Iterators with the Stream.

I'd appreciate hearing your thoughts on this and would welcome any support or guidance if a decision is made to move forward with a PR.

@borispovod borispovod changed the title [Bug] std::sync::RwLock and tokio runtime std::sync::RwLock and tokio runtime Sep 15, 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