Function wasmer_wasix::spawn_blocking

source ·
pub(crate) async fn spawn_blocking<F, R>(f: F) -> Result<R, JoinError>
where F: FnOnce() -> R + Send + 'static, R: Send + 'static,
Expand description

Spawns a new blocking task that runs the provided closure.

The closure is executed on a separate thread, allowing it to perform blocking operations without blocking the main thread. The closure is wrapped in a Future that resolves to the result of the closure’s execution.