File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,8 @@ use std::thread;
93
93
use std:: time:: Duration ;
94
94
95
95
use async_channel:: { bounded, Receiver } ;
96
- use async_task:: { Runnable , Task } ;
96
+ use async_task:: Runnable ;
97
+ pub use async_task:: Task ;
97
98
use atomic_waker:: AtomicWaker ;
98
99
use futures_lite:: { future, prelude:: * , ready} ;
99
100
use once_cell:: sync:: Lazy ;
@@ -267,12 +268,12 @@ impl Executor {
267
268
/// let out = unblock(|| Command::new("dir").output()).await?;
268
269
/// # std::io::Result::Ok(()) });
269
270
/// ```
270
- pub async fn unblock < T , F > ( f : F ) -> T
271
+ pub fn unblock < T , F > ( f : F ) -> Task < T >
271
272
where
272
273
F : FnOnce ( ) -> T + Send + ' static ,
273
274
T : Send + ' static ,
274
275
{
275
- Executor :: spawn ( async move { f ( ) } ) . await
276
+ Executor :: spawn ( async move { f ( ) } )
276
277
}
277
278
278
279
/// Runs blocking I/O on a thread pool.
You can’t perform that action at this time.
0 commit comments