File tree 2 files changed +6
-5
lines changed
2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ use kv_log_macro::trace;
21
21
///
22
22
/// See also: [`task::blocking`].
23
23
///
24
- /// [`task::blocking `]: fn.blocking .html
24
+ /// [`task::spawn_blocking `]: fn.spawn_blocking .html
25
25
///
26
26
/// [spawning]: https://doc.rust-lang.org/std/thread/fn.spawn.html
27
27
/// [joining]: https://doc.rust-lang.org/std/thread/struct.JoinHandle.html#method.join
Original file line number Diff line number Diff line change @@ -55,9 +55,10 @@ pub(crate) mod blocking;
55
55
/// is useful to prevent long-running synchronous operations from blocking the main futures
56
56
/// executor.
57
57
///
58
- /// See also: [`task::block_on`].
58
+ /// See also: [`task::block_on`], [`task::spawn`] .
59
59
///
60
60
/// [`task::block_on`]: fn.block_on.html
61
+ /// [`task::spawn`]: fn.spawn.html
61
62
///
62
63
/// # Examples
63
64
///
@@ -68,7 +69,7 @@ pub(crate) mod blocking;
68
69
/// #
69
70
/// use async_std::task;
70
71
///
71
- /// task::blocking (|| {
72
+ /// task::spawn_blocking (|| {
72
73
/// println!("long-running task here");
73
74
/// }).await;
74
75
/// #
@@ -79,10 +80,10 @@ pub(crate) mod blocking;
79
80
#[ cfg( any( feature = "unstable" , feature = "docs" ) ) ]
80
81
#[ cfg_attr( feature = "docs" , doc( cfg( unstable) ) ) ]
81
82
#[ inline]
82
- pub fn blocking < F , R > ( f : F ) -> task:: JoinHandle < R >
83
+ pub fn spawn_blocking < F , R > ( f : F ) -> task:: JoinHandle < R >
83
84
where
84
85
F : FnOnce ( ) -> R + Send + ' static ,
85
86
R : Send + ' static ,
86
87
{
87
- blocking:: spawn_blocking ( future )
88
+ blocking:: spawn ( f )
88
89
}
You can’t perform that action at this time.
0 commit comments