pub struct Supervisor { /* private fields */ }Expand description
Process-local orchestrator for Runtime-owned managed services.
The supervisor never starts, stops, or replaces its host process.
Implementations§
Source§impl Supervisor
impl Supervisor
Sourcepub fn diagnose(&self) -> SupervisorDiagnosis
pub fn diagnose(&self) -> SupervisorDiagnosis
Returns a deterministic diagnostic report without mutating services.
Sourcepub fn snapshots(&self) -> Vec<ServiceSnapshot>
pub fn snapshots(&self) -> Vec<ServiceSnapshot>
Returns current service snapshots in lexical order.
Sourcepub fn events(&self) -> Vec<SupervisorEvent>
pub fn events(&self) -> Vec<SupervisorEvent>
Returns retained lifecycle events without removing them.
Sourcepub fn is_healthy(&self, timestamp_ms: u64) -> bool
pub fn is_healthy(&self, timestamp_ms: u64) -> bool
Reports whether graph, watchdog, executor, and critical services are healthy.
Source§impl Supervisor
impl Supervisor
Sourcepub fn reconcile(&self, timestamp_ms: u64) -> SupervisorResult<()>
pub fn reconcile(&self, timestamp_ms: u64) -> SupervisorResult<()>
Reconciles health and schedules restart work without executing it inline.
Sourcepub fn restart(&self, name: &str, timestamp_ms: u64) -> SupervisorResult<()>
pub fn restart(&self, name: &str, timestamp_ms: u64) -> SupervisorResult<()>
Schedules one restart while enforcing its temporal budget.
Sourcepub fn stop(&self, name: &str, timestamp_ms: u64) -> SupervisorResult<()>
pub fn stop(&self, name: &str, timestamp_ms: u64) -> SupervisorResult<()>
Stops one enabled service without affecting the host process.
Sourcepub fn evaluate_watchdog(&self, timestamp_ms: u64) -> WatchdogSnapshot
pub fn evaluate_watchdog(&self, timestamp_ms: u64) -> WatchdogSnapshot
Independently evaluates watchdog progress and emits transition events.
Sourcepub fn shutdown(&self, timestamp_ms: u64) -> SupervisorResult<()>
pub fn shutdown(&self, timestamp_ms: u64) -> SupervisorResult<()>
Stops the restart executor and all enabled services in reverse order.
Source§impl Supervisor
impl Supervisor
Sourcepub fn with_watchdog_config(config: WatchdogConfig) -> SupervisorResult<Self>
pub fn with_watchdog_config(config: WatchdogConfig) -> SupervisorResult<Self>
Creates an empty supervisor with installation watchdog policy.
Sourcepub fn with_event_capacity(event_capacity: usize) -> Self
pub fn with_event_capacity(event_capacity: usize) -> Self
Creates an empty supervisor with an explicit event bound.
Sourcepub fn same_instance(&self, other: &Self) -> bool
pub fn same_instance(&self, other: &Self) -> bool
Reports whether two handles reference the same supervisor instance.
Sourcepub fn watchdog(&self) -> Arc<SupervisorWatchdog> ⓘ
pub fn watchdog(&self) -> Arc<SupervisorWatchdog> ⓘ
Returns the lock-independent watchdog shared with health consumers.
Sourcepub fn register(&self, service: Arc<dyn ManagedService>) -> SupervisorResult<()>
pub fn register(&self, service: Arc<dyn ManagedService>) -> SupervisorResult<()>
Registers one unique service without starting it.
Sourcepub fn register_or_replace_inactive(
&self,
service: Arc<dyn ManagedService>,
) -> SupervisorResult<()>
pub fn register_or_replace_inactive( &self, service: Arc<dyn ManagedService>, ) -> SupervisorResult<()>
Registers a service or replaces an inactive deployment placeholder.
An enabled registration is never replaced because it may own resources.
Sourcepub fn validate(&self) -> SupervisorResult<Vec<String>>
pub fn validate(&self) -> SupervisorResult<Vec<String>>
Validates policies and returns dependency-first service order.
Sourcepub fn start_all(&self) -> SupervisorResult<()>
pub fn start_all(&self) -> SupervisorResult<()>
Starts all enabled services in dependency order.
Trait Implementations§
Source§impl Clone for Supervisor
impl Clone for Supervisor
Source§fn clone(&self) -> Supervisor
fn clone(&self) -> Supervisor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more