Skip to main content

run_runtime_lease_supervisor

Function run_runtime_lease_supervisor 

Source
pub async fn run_runtime_lease_supervisor<Store, StartFn, Workload, StopFn, StopFut>(
    store: Store,
    config: RuntimeLeaseConfig,
    shutdown_token: CancellationToken,
    start_workload: StartFn,
    stop_workload: StopFn,
)
where Store: RuntimeLeaseStore, StartFn: FnMut(CancellationToken) -> Workload + Send, StopFn: FnMut(Workload) -> StopFut + Send, StopFut: Future<Output = ()> + Send,
Expand description

Runs one singleton worker group behind a runtime lease.

The supervisor stays alive until shutdown_token is cancelled. Standby instances retry acquisition periodically. The active owner renews its lease; if renewal fails or reports lost ownership, the workload is cancelled and stopped before the supervisor returns to standby mode.