[][src]Function async_global_executor::run

pub fn run<F: Future<Output = T> + Send + 'static, T: Send + 'static>(
    future: F
) -> T

Runs the global and the local executor on the current thread

Note: this calls smol::block_on underneath.

Examples

let task = async_global_executor::spawn(async {
    1 + 2
});
async_global_executor::run(async {
    assert_eq!(task.await, 3);
});