blob: ed8b52d0737d4fcd741cd575ae5324bc7a847beb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
use tokio_futures::compat;
/// Like `tokio::run`, but takes an `async` block
pub fn run_async<F>(future: F)
where
F: std::future::Future<Output = ()> + Send + 'static,
{
::run(compat::infallible_into_01(future));
}
/// Like `tokio::spawn`, but takes an `async` block
pub fn spawn_async<F>(future: F)
where
F: std::future::Future<Output = ()> + Send + 'static,
{
::spawn(compat::infallible_into_01(future));
}
|