block_on

Function block_on 

Source
pub fn block_on<Fut: Future>(future: Fut) -> Fut::Output
Expand description

Blocks the current thread until the future is polled to finish.

Example

let result = spawn_groups::block_on(async {
    println!("This is an async executor");
    1
});
assert_eq!(result, 1);