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
Update documentation on block_in_place #3753
Conversation
tokio/src/task/blocking.rs
Outdated
@@ -6,18 +6,23 @@ cfg_rt_multi_thread! { | |||
/// | |||
/// In general, issuing a blocking call or performing a lot of compute in a | |||
/// future without yielding is not okay, as it may prevent the executor from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated, but "is not okay" probably can be reworded to: "is problematic"
tokio/src/task/blocking.rs
Outdated
/// instead. | ||
/// | ||
/// Note that this function can only be used when using the `multi_thread` runtime. | ||
/// driving other tasks forward. By using this function, the executor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Calling this function informs the executor that the currently executing task is about to block the thread"
maybe? TOLI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, one wording suggestion, but not a blocker.
This PR updates the documentation on
block_in_place
to fix some things that were unclear. There is already a PR that tries to address this, but I have found that the documentation needed a larger change.Closes: #3659, #3658