[go: up one dir, main page]

run

Function run 

Source
pub fn run<F, T>(future: F, stack: ProcStack) -> T
where F: Future<Output = T>,
Expand description

This method blocks the current thread until passed future is resolved with an output (including the panic).

It is called block_on or blocking in some executors.

ยงExample

use bastion_executor::prelude::*;
use lightproc::prelude::*;
let mut sum = 0;

run(
    async {
        (0..10_000_000).for_each(|_| {
            sum += 1;
        });
    },
    ProcStack::default(),
);