pub fn spawn<F, T>(future: F, stack: ProcStack) -> RecoverableHandle<T>Expand description
Spawn a process (which contains future + process stack) onto the executor from the global level.
ยงExample
use bastion_executor::prelude::*;
use lightproc::prelude::*;
let pid = 1;
let stack = ProcStack::default().with_pid(pid);
let handle = spawn(
async {
panic!("test");
},
stack.clone(),
);
run(
async {
handle.await;
},
stack.clone(),
);