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
Lint idea: find known-blocking constructs in async contexts #4377
Labels
Comments
|
Dylan-DPC-zz
pushed a commit
to Dylan-DPC-zz/rust
that referenced
this issue
May 13, 2020
Warn against thread::sleep in async fn I've seen `thread::sleep` wrecking havoc in async servers. There's already an [issue for clippy](rust-lang/rust-clippy#4377), but the std docs could warn against it too.
Dylan-DPC-zz
pushed a commit
to Dylan-DPC-zz/rust
that referenced
this issue
May 13, 2020
Warn against thread::sleep in async fn I've seen `thread::sleep` wrecking havoc in async servers. There's already an [issue for clippy](rust-lang/rust-clippy#4377), but the std docs could warn against it too.
Dylan-DPC-zz
pushed a commit
to Dylan-DPC-zz/rust
that referenced
this issue
May 14, 2020
Warn against thread::sleep in async fn I've seen `thread::sleep` wrecking havoc in async servers. There's already an [issue for clippy](rust-lang/rust-clippy#4377), but the std docs could warn against it too.
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With
async/await
coming up, we will probably see an uptake of such code:Users will most likely not be aware that the call to
println
are blocking. The same goes to any use of the stdlib io apis, most famouslyto_socket_addr()
calls.I think there is a chance for clippy to at least find obvious cases of this, for a list of known functions.
The text was updated successfully, but these errors were encountered: