mecha10-core 0.8.0

Mecha10 core runtime and foundational types
Documentation
//! Service Discovery
//!
//! Provides automatic node registration and discovery capabilities.
//! Nodes can register themselves, discover other nodes, and find publishers/subscribers
//! for specific topics.
//!
//! # Architecture
//!
//! - Uses Redis as the registry backend
//! - Nodes register with TTL (time-to-live) and heartbeat
//! - Automatic registration on Context creation
//! - Automatic unregistration on shutdown
//! - Query by node type, topic, or capability
//!
//! # Example
//!
//! ```rust
//! use mecha10_core::prelude::*;
//! use mecha10_core::discovery::{DiscoveryExt, NodeMetadata};
//!
//! # async fn example() -> Result<()> {
//! let ctx = Context::new("my-node").await?;
//!
//! // Register with metadata (auto-registers on Context::new)
//! ctx.register(NodeMetadata {
//!     node_type: "perception".to_string(),
//!     publishes: vec!["/perception/detections".to_string()],
//!     subscribes: vec!["/sensors/camera/rgb".to_string()],
//!     capabilities: vec!["object_detection".to_string()],
//!     ..Default::default()
//! }).await?;
//!
//! // Discover nodes by type
//! let cameras = ctx.discover_by_type("camera_driver").await?;
//! for node in cameras {
//!     println!("Found camera: {} at {:?}", node.node_id, node.publishes);
//! }
//!
//! // Find who publishes a topic
//! let publishers = ctx.discover_publishers("/sensors/lidar").await?;
//!
//! # Ok(())
//! # }
//! ```

mod metadata;
mod redis_client;
#[cfg(feature = "messaging")]
mod registry;

pub use metadata::{NodeMetadata, NodeStatus};
#[cfg(feature = "messaging")]
pub use registry::DiscoveryExt;