Skip to main content

spawn_cell

Macro spawn_cell 

Source
macro_rules! spawn_cell {
    ($cell:expr, $body:expr $(,)?) => { ... };
}
Expand description

Spawn a task using a Cell by taking its context, restoring the context synchronously in the spawned closure, and returning the provided future directly to the runtime.

The macro uses the context’s default spawn configuration (supervised, shared executor with blocking == false). If you need to mark the task as blocking or request a dedicated thread, take the context via Cell::take and call the appropriate crate::Spawner methods before spawning.