8 releases
| new 0.1.46 | Jan 25, 2026 |
|---|---|
| 0.1.40 | Jan 9, 2026 |
| 0.1.23 | Dec 30, 2025 |
| 0.1.1 | Nov 24, 2025 |
#963 in Database interfaces
128 downloads per month
Used in 22 crates
(21 directly)
1MB
13K
SLoC
@mecha10/core
Runtime orchestration and node lifecycle management for the Mecha10 framework.
Features
- ✅ Node Lifecycle - Start, stop, restart node processes
- ✅ Health Monitoring - Automatic health checks with configurable intervals
- ✅ Auto-Restart - Restart crashed nodes (up to 3 attempts)
- ✅ Graceful Shutdown - SIGTERM handling with timeout fallback
- ✅ State Tracking - Track node states (Stopped, Starting, Running, Crashed, etc.)
- ✅ Background Tasks - Async health check loop with tokio
Status
✅ Fully Implemented - 467 lines, production-ready
Installation
[dependencies]
mecha10-core = { path = "../core" }
tokio = { version = "1.35", features = ["full"] }
serde = { version = "1.0", features = ["derive"] }
Quick Start
use mecha10_core::{Runtime, NodeConfig, NodeMode};
use std::collections::HashMap;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut runtime = Runtime::new("my-robot").await?;
// Start a camera node
runtime.start_node(NodeConfig {
id: "camera".to_string(),
executable: "./nodes/camera_node".to_string(),
args: vec!["--resolution=1080p".to_string()],
env: HashMap::new(),
mode: Some(NodeMode::Local),
auto_restart: true,
health_check_interval_s: 5,
}).await?;
println!("Started {} nodes", runtime.list_nodes().await.len());
// Run until Ctrl+C
runtime.run().await?;
Ok(())
}
API Reference
See full documentation in packages/core/README.md
Examples
See QUICKSTART.md for complete examples.
License
MIT
Dependencies
~28–47MB
~649K SLoC