Skip to main content

spawn_pup

Function spawn_pup 

Source
pub fn spawn_pup<F>(job: F) -> DogeResult
where F: FnOnce() -> Result<Packed, PackedError> + Send + 'static,
Expand description

Spawn a job onto a fresh pup thread and hand back the pup value. The job produces the packed result (or error) the pup’s fetch will return. Shared by both engines: the compiler passes a generated trampoline, the interpreter a closure that runs a fresh interpreter. A thread the OS refuses to start is a catchable IOError.