Skip to content

Commit

Permalink
docs: add note about current-thread + Handle::block_on (#5264)
Browse files Browse the repository at this point in the history
There's already an existing warning about this combo in the
documentation for `Handle::block_on`. This commit adds a summarized
version in `Runtime::handle`.
  • Loading branch information
sharnoff authored Dec 5, 2022
1 parent 00bf5ee commit 86ffabe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tokio/src/runtime/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ impl Runtime {
/// The returned handle can be used to spawn tasks that run on this runtime, and can
/// be cloned to allow moving the `Handle` to other threads.
///
/// Calling [`Handle::block_on`] on a handle to a `current_thread` runtime is error-prone.
/// Refer to the documentation of [`Handle::block_on`] for more.
///
/// # Examples
///
/// ```
Expand Down

0 comments on commit 86ffabe

Please sign in to comment.