plexus_core/builder.rs
1//! Example DynamicHub builder
2//!
3//! This module provides an example of how to build a DynamicHub instance.
4//! Real applications should create their own builder with their specific activations.
5
6use std::sync::Arc;
7
8use crate::activations::echo::Echo;
9use crate::activations::health::Health;
10use crate::plexus::DynamicHub;
11
12/// Build an example hub with minimal activations
13///
14/// This demonstrates how to construct a DynamicHub instance.
15/// Real applications should define their own builder function
16/// that registers their specific activations.
17///
18/// DynamicHub itself provides introspection methods:
19/// - {namespace}.call: Route calls to registered activations
20/// - {namespace}.hash: Get configuration hash for cache invalidation
21/// - {namespace}.schema: Get plugin schemas
22pub fn build_example_hub() -> Arc<DynamicHub> {
23 Arc::new(
24 DynamicHub::new("example")
25 .register(Health::new())
26 .register(Echo::new()),
27 )
28}