Skip to main content

with_fiber_context

Function with_fiber_context 

Source
pub async fn with_fiber_context<F>(
    phase: Arc<str>,
    controls: ControlMap,
    fut: F,
) -> F::Output
where F: Future,
Expand description

Wrap a fiber’s async body in a FiberContext scope. Every runtime-context node read performed inside the future sees the phase name and cycle counter set here.

Cycle starts at 0 and is updated via set_task_cycle on every iteration of the fiber’s loop.