Skip to main content

background_task_component_from_shutdown

Function background_task_component_from_shutdown 

Source
pub fn background_task_component_from_shutdown<F>(
    spawn: F,
) -> BackgroundTaskRuntimeComponentFromShutdown<F>
where F: FnOnce(CancellationToken) -> BackgroundTasks,
Expand description

Creates a runtime component that spawns background tasks from the shared shutdown token.

Use this from product entrypoints when worker creation needs the same shutdown token owned by AsterRuntime. Forge handles the runtime-component adapter; product code only supplies the worker spawning function.