Expand description
Module Service Registry - Discovery and access to module services
The Service Registry provides a centralized way for bounded contexts (modules) to expose services that other modules can discover and use. This enables loose-coupled inter-module communication beyond events.
§Architecture
┌────────────────────────────┐
│ ServiceRegistry │
│ (Application Bootstrap) │
└────────────────────────────┘
│
┌───────────────┼───────────────┐
│ │ │
▼ ▼ ▼
┌────────────┐ ┌────────────┐ ┌────────────┐
│ Sapiens │ │ Postman │ │ Bucket │
│ Services │ │ Services │ │ Services │
└────────────┘ └────────────┘ └────────────┘§Usage
ⓘ
use backbone_core::registry::{ServiceRegistry, ModuleService};
// Create registry in main app
let registry = ServiceRegistry::new();
// Register services from modules
registry.register(user_query_service).await;
registry.register(email_service).await;
// Look up services
if let Some(service) = registry.get("sapiens.user_query").await {
// Use the service
}Structs§
- Registry
Health - Health report for the entire registry
- Registry
Statistics - Statistics about the registry
- Service
Descriptor - Metadata about a registered service
- Service
Health - Health status of a service
- Service
Registry - Registry for discovering and accessing module services
Enums§
Traits§
- Module
Service - Trait for module services that can be registered and discovered