pub struct ServiceLifecycle<S> { /* private fields */ }Expand description
Runs one service future with shared Aster shutdown mechanics.
This lower-level helper exists for tests and uncommon one-off runners. New
product entrypoints should prefer AsterRuntime::builder and register the
main service through RuntimeServiceComponent.
Implementations§
Source§impl<S> ServiceLifecycle<S>
impl<S> ServiceLifecycle<S>
Source§impl<S> ServiceLifecycle<S>where
S: Future,
impl<S> ServiceLifecycle<S>where
S: Future,
Sourcepub async fn run<Stop, StopFut, AfterStop, AfterStopFut>(
self,
stop_on_signal: Stop,
after_stop: AfterStop,
) -> S::Output
pub async fn run<Stop, StopFut, AfterStop, AfterStopFut>( self, stop_on_signal: Stop, after_stop: AfterStop, ) -> S::Output
Runs the service future and product cleanup hooks.
Cancels and joins its signal listener before invoking after_stop; dropping this run
future also aborts the listener so it cannot retain resources of an abandoned service.
Cancellation is signalled before cleanup, including service panic and run cancellation.
§Panics
Service panics are resumed with their original payload after after_stop. If only cleanup
panics, its panic is resumed; if both panic, the original service panic takes precedence.
Destruction of the completed service future is part of this boundary.