Skip to main content

runtime_component_with_shutdown

Function runtime_component_with_shutdown 

Source
pub fn runtime_component_with_shutdown<C, F>(
    build: F,
) -> RuntimeComponentWithShutdown<C, F>
where F: FnOnce(CancellationToken) -> C,
Expand description

Builds one runtime component from the runtime’s shared shutdown token.

Use this when a product component needs the same token that AsterRuntime cancels on termination signals, for example an HTTP server, config reload subscription, or background worker group.