Skip to content

Commit e08014a

Browse files
committed
spawn using async-std
1 parent 0dda0d3 commit e08014a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/runtime.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ cfg_if::cfg_if! {
88
pub fn spawn(f: impl Future<Output = ()> + Send + 'static) -> JoinHandle<()> {
99
tokio::spawn(f)
1010
}
11+
} else if #[cfg(all(feature = "async-std-comp", not(feature = "tokio-comp")))] {
12+
pub fn spawn(f: impl Future<Output = ()> + Send + 'static) -> JoinHandle<()> {
13+
async_std::task::spawn(f)
14+
}
1115
} else {
1216
compile_error!("tokio-comp or async-std-comp features required");
1317
}

0 commit comments

Comments
 (0)