pub fn block_on<F, T>(future: F) -> T
where F: Future<Output = T>,
Expand description

Runs the global and the local executor on the current thread

Note: this calls async_io::block_on underneath.

Examples

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