Skip to main content

background_task_component_with_definitions_from_shutdown

Function background_task_component_with_definitions_from_shutdown 

Source
pub fn background_task_component_with_definitions_from_shutdown<Kind, PresentationCode, F>(
    definitions: &'static [RuntimeTaskDefinition<Kind, PresentationCode>],
    spawn: F,
) -> BackgroundTaskRuntimeDefinitionsComponentFromShutdown<Kind, PresentationCode, F>
where Kind: Sync + 'static, PresentationCode: Sync + 'static, F: FnOnce(CancellationToken) -> BackgroundTasks,
Expand description

Creates a task-definition component that spawns workers from the shared shutdown token.

This is the high-level component factory for Aster products that use AsterRuntime::builder().component(...): product code passes its static task definitions and one worker-spawning function, while Forge owns the adapter between the runtime shutdown token and the background-task shutdown component.