Function trillium_testing::prelude::block_on
pub fn block_on<F, T>(future: F) -> Twhere
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);
});