saturnin.base.component¶
Saturnin abstract base class for Components.
Saturnin components are microservices, services or other software components that could be executed on Saturnin platform, typically under supervision of Controller(s).
Classes¶
- class saturnin.base.component.ComponentConfig(name: str)[source]¶
Bases:
ConfigBase Component configuration.
- Parameters:
name (str) – Component name (used as conf. file section name for component).
- agent: UUIDOption¶
Agent identification
- class saturnin.base.component.Component[source]¶
Bases:
ABCAbstract base class for Saturnin Components, which represent executable units like microservices or services managed by the platform.
- abstractmethod initialize(config: ComponentConfig) None[source]¶
Verify configuration and assemble component structural parts.
- Parameters:
config (ComponentConfig) – Component configuration.
- Return type:
None
- abstractmethod warm_up(ctrl_addr: ZMQAddress | None) None[source]¶
Initializes essential communication infrastructure for the component.
Implementations must initialize their
ChannelManagerand establish a connection to the control channel at the providedctrl_addr. This connection is typically used for Inter-Component Communication Protocol (ICCP) with a controller.- Parameters:
ctrl_addr (ZMQAddress | None) – The ZMQ address of the controller’s control channel. If
None, the component might operate in a standalone mode or a specific behavior should be defined by the implementer.- Return type:
None
Functions¶
- saturnin.base.component.create_config(_cls: type[ComponentConfig], agent: UUID, name: str) ComponentConfig[source]¶
Returns a newly created
ComponentConfiginstance (or a subclass instance).This function is primarily intended to be used with
functools.partialwhen defining theconfigfactory inServiceDescriptorinstances.- Parameters:
_cls (type[ComponentConfig]) – The
ComponentConfigclass (or a subclass of it) to instantiate.agent (UUID) – The UUID for component identification, to be set in the config.
name (str) – The name to be used by the configuration class (often for section naming).
- Returns:
An initialized instance of the provided
_cls.- Return type: