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

Blocking `thread::sleep` inside an async fn #64

Open
hwchen opened this issue Nov 25, 2019 · 0 comments
Open

Blocking `thread::sleep` inside an async fn #64

hwchen opened this issue Nov 25, 2019 · 0 comments

Comments

@hwchen
Copy link

@hwchen hwchen commented Nov 25, 2019

I've seen several async beginners try to use thread::sleep to try to wrap their brains around async. It's probably one of the most common ways to "see" async. I just want to make sure it's addressed in the async book. (I haven't read it, but at least one of the reddit threads was lifted from the book's join example).

There's also the possibility of a clippy lint, but beginners may not have gotten there yet.

rust-lang/rust-clippy#4377

https://old.reddit.com/r/rust/comments/e1gxf8/not_understanding_asyncawait_properly/
https://old.reddit.com/r/rust/comments/dtp6z7/what_can_i_actually_do_with_the_new_async_fn/
https://old.reddit.com/r/rust/comments/dt0ruy/how_to_await_futures_concurrently/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.