Skip to main content

spawn_blocking

Function spawn_blocking 

Source
pub async fn spawn_blocking<F, R>(f: F) -> R
where F: FnOnce() -> R + MaybeSend + 'static, R: MaybeSend + 'static,
Expand description

Runs CPU-bound work off the async workers so they stay schedulable.

Meant for the pairings that verify signature and decryption shares. Wasm has no blocking pool, so there the work runs inline.