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

Sync and Async/Await #12

Open
dbcfd opened this issue Jan 25, 2020 · 2 comments
Open

Sync and Async/Await #12

dbcfd opened this issue Jan 25, 2020 · 2 comments

Comments

@dbcfd
Copy link
Contributor

dbcfd commented Jan 25, 2020

Async/Await code should use an async concurrency primitive (e.g. tokio::sync::RwLock).

Non async primitives will produce errors like

`std::sync::RwLockReadGuard<'_, ratsio::stan_client::ClientInfo>` cannot be sent between threads safely

Additionally, since they do not wake the executor, they can cause threads in the executor to enter infinite wait states.

@giacomocariello
Copy link

dbcfd seems to fix the issue successfully. Could @mnetship please accept the PR and possibly publish a new release on crates.io?

@ebkalderon
Copy link

I'm glad that there already exists a pull request which switches from blocking std::sync::RwLock to non-blocking tokio::sync::Mutex. I was about to open an issue and PR to fix this myself. Nice to see someone else got to it first! It's a big blocker for me using this library. 😄

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

3 participants