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:
Config
Base 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:
ABC
Abstract base class for Saturnin Components.
- abstract initialize(config: ComponentConfig) None [source]¶
Verify configuration and assemble component structural parts.
- Parameters:
config (ComponentConfig) – Component configuration.
- Return type:
None
- abstract warm_up(ctrl_addr: ZMQAddress | None) None [source]¶
Must initialize the
ChannelManager
and connect component to control channel at provided address.- Parameters:
ctrl_addr (ZMQAddress | None) – Controller’s address for ICCP communication with component.
- Return type:
None
Functions¶
- saturnin.base.component.create_config(_cls: Type[ComponentConfig], agent: UUID, name: str) ComponentConfig [source]¶
Returns newly created
ComponentConfig
instance.Intended to be used with
functools.partial
inServiceDescriptor.config
definitions.- Parameters:
_cls (Type[ComponentConfig]) – Class for component configuration.
agent (UUID) – Component identification.
name (str) – Name to be used by configuration class.
- Return type: