Skip to main content

Module registry

Module registry 

Source
Expand description

ComponentRegistry: ordered, dependency-aware, type-erased registry for every Component in the runtime.

§Responsibilities

§Lifecycle ordering

  register(...)        # queues factory
      ↓
  init_all()           # topo order, dep-first
      ↓
  start_all()          # topo order
  ... serve ...
      ↓
  stop_all()           # reverse topo order

On init error, the registry leaves the offending component in a ComponentState::Failed state and continues to attempt initialization of any components that do not depend on it. This maximizes operator visibility: a single broken optional backend should not prevent the rest of the system from coming up.

Structs§

ComponentDescriptor
Static descriptor of a component kind, used by the registry to plan initialization order without holding the actual factory.
ComponentRegistry
The central component registry.
TypedAnyComponent
Adapter from a typed Component to the type-erased AnyComponent trait. Created by TypedFactory::build.
TypedFactory
Convenience wrapper that adapts a concrete Component into a ComponentFactory.

Enums§

ComponentState
Initialization state of a registered component.
RegistryError
Errors raised by ComponentRegistry operations.

Traits§

ComponentFactory
Type-erased factory for a concrete Component type. The registry holds factories as Box<dyn ComponentFactory> so it can drive heterogeneous types uniformly.