Function uexec::block_on[][src]

pub fn block_on<R: 'static, F: Future<Output = R> + 'static>(future: F) -> R

Runs the global and the local executor on the current thread until the given future is Ready

Examples

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