Components
provide.foundation.hub.components
¶
TODO: Add module docstring.
Classes¶
ComponentCategory
¶
Bases: Enum
Predefined component categories for Foundation.
These are the standard dimension values used internally by Foundation. External components can still use custom string dimensions for compatibility.
ComponentInfo
¶
Information about a registered component.
ComponentLifecycle
¶
Functions¶
bootstrap_foundation
¶
Bootstrap Foundation with core registry components.
Source code in provide/foundation/hub/components.py
check_component_health
¶
Check component health status.
Source code in provide/foundation/hub/components.py
cleanup_all_components
¶
Clean up all components in dimension.
Source code in provide/foundation/hub/lifecycle.py
discover_components
¶
discover_components(
group: str,
dimension: str | None = None,
registry: Registry | None = None,
) -> dict[str, type[Any]]
Discover and register components from entry points.
Uses the @resilient decorator for standardized error handling.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
group
|
str
|
Entry point group name (e.g., 'provide.components') |
required |
dimension
|
str | None
|
Registry dimension for components (defaults to "component") |
None
|
registry
|
Registry | None
|
Optional registry to use (defaults to global registry) |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, type[Any]]
|
Dictionary mapping component names to their classes |
Source code in provide/foundation/hub/discovery.py
execute_error_handlers
¶
Execute error handlers until one handles the exception.
Source code in provide/foundation/hub/handlers.py
get_component_config_schema
¶
Get component configuration schema.
Source code in provide/foundation/hub/components.py
get_component_registry
¶
get_config_chain
¶
Get configuration sources ordered by priority.
Source code in provide/foundation/hub/config.py
get_handlers_for_exception
¶
Get error handlers that can handle the given exception type.
Source code in provide/foundation/hub/handlers.py
get_or_initialize_component
¶
Get component, initializing lazily if needed.
Source code in provide/foundation/hub/lifecycle.py
get_processor_pipeline
¶
Get log processors ordered by priority.
Source code in provide/foundation/hub/processors.py
get_processors_for_stage
¶
Get processors for a specific processing stage.
initialize_all_async_components
async
¶
Initialize all async components in dependency order.
Source code in provide/foundation/hub/lifecycle.py
initialize_async_component
async
¶
Initialize component asynchronously.
Source code in provide/foundation/hub/lifecycle.py
load_all_configs
async
¶
Load configurations from all registered sources.
Source code in provide/foundation/hub/config.py
load_config_from_registry
¶
Load configuration from registry sources.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config_class
|
type[T]
|
Configuration class to instantiate |
required |
Returns:
| Type | Description |
|---|---|
T
|
Configuration instance loaded from registry sources |
Source code in provide/foundation/hub/config.py
resolve_component_dependencies
¶
Resolve component dependencies recursively.
Source code in provide/foundation/hub/discovery.py
resolve_config_value
¶
Resolve configuration value using priority-ordered sources.