ProcessingElement
- class ioiocore.processing_element.ProcessingElement(**kwargs)[source]
Bases:
ABC,PortableAbstract base class for all processing elements in a pipeline.
This is the common base for both Node (concrete processing nodes) and Chain (containers of nodes). It provides the shared interface that Pipeline uses to manage elements.
- _IMP_CLASS
The implementation class for the ProcessingElement.
- Type:
type
- _imp
The instance of the implementation class.
- Type:
- config
The configuration object for the ProcessingElement.
- Type:
- class Configuration(name=None, **kwargs)[source]
Bases:
ConfigurationConfiguration class for the ProcessingElement.
- Parameters:
name (str)
- config: Configuration
- create_config(**kwargs)[source]
Factory method to create the configuration for the ProcessingElement.
Sets name to the interface class name if not provided. This ensures that concrete subclasses that don’t define their own Configuration class still get the correct name (e.g., a concrete OChain subclass will be named after itself, not “OChain”).
- Parameters:
**kwargs – Additional keyword arguments for configuring the ProcessingElement.
- failure()[source]
The exception this element raised, kept whole.
- Returns:
What setup() or a cycle raised, or None if nothing did.
Reported alongside the log entry rather than instead of it, because the two serve different readers. The log is what a running system writes down; this is what a caller needs to raise from, so the element’s own frames end up in front of the user instead of a sentence quoting them.
The first failure is kept. A node that fails during setup returns from every later cycle without processing, and the condition it leaves behind makes the next cycle look like a fresh failure – so overwriting would replace the cause with its consequence.
- Return type:
Exception
- get_condition()[source]
Get the current condition.
- Returns:
HEALTHY, WARNING or ERROR. An element sets ERROR on itself when its setup or its step raises, and only reset_run_state() clears it again.
- Return type:
- property name: str
Get the name of this processing element.
- setup_failed()[source]
Whether setup() raised, as opposed to a later cycle.
- Returns:
True if this element’s setup() raised. Reported apart from the condition because the two mean different things to a caller: a step that raises is a run that died, while a setup that raises is an element that was never viable – which the start() the caller is still inside can still refuse.
- Return type:
bool