Module registry

Module registry 

Source
Expand description

Service registry for dependency injection Service registry and dependency injection

Provides a runtime registry for wiring together ports and adapters.

Key features:

  • Thread-safe dynamic registration via Arc<RwLock<…>>
  • Builder pattern for ergonomic construction
  • LazyLock-based process-wide default registry singleton
  • Per-service health checks and availability status

§Example

use stygian_graph::application::registry::ServiceRegistry;
use stygian_graph::adapters::noop::NoopService;
use std::sync::Arc;

let registry = ServiceRegistry::builder()
    .register("noop", Arc::new(NoopService))
    .build();

let svc = registry.get("noop");
assert!(svc.is_some());

Structs§

RegistryBuilder
Builder for constructing a ServiceRegistry.
ServiceRegistry
Thread-safe runtime registry for ScrapingService adapters.

Enums§

ServiceStatus
Availability status of a registered service

Functions§

global_registry
Process-wide default service registry singleton.