1 2 3 4 5 6 7 8 9 10 11 12
use tokio::prelude::Future; use tokio::spawn; pub fn run(f: impl Future<Output=()>) { tokio_executor::current_thread::block_on_all(async { f.await; }) } pub fn start(fut: impl Future<Output=()> + 'static) { tokio_executor::current_thread::spawn(fut); }