mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-18 00:00:09 +02:00
docs: add note about current-thread + Handle::block_on (#5264)
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`.
This commit is contained in:
@@ -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
|
||||
///
|
||||
/// ```
|
||||
|
||||
Reference in New Issue
Block a user