Expand description
Lifecycle management for mode-based dynamic node control
This module provides the lifecycle manager that orchestrates node start/stop based on operational mode changes.
§Architecture
CLI → Redis (mode/request) → LifecycleManager → Supervisor → NodesThe lifecycle manager:
- Subscribes to mode change requests
- Calculates which nodes need to start/stop
- Uses Supervisor to execute changes
- Publishes mode changed events
§Example
ⓘ
use mecha10_runtime::lifecycle::LifecycleManager;
let lifecycle = LifecycleManager::new(
context,
supervisor,
mode_config,
"startup".to_string(),
);
// Run in background
tokio::spawn(async move {
lifecycle.run().await
});Structs§
Traits§
Functions§
- diff_
nodes - Calculate which nodes need to start/stop to transition to a target set of nodes