gemseo.core.execution_status module#
Execution status of processes.
- class ExecutionStatus(process_name)[source]#
Bases:
SerializableExecution status of a process.
The status aims at monitoring a process and give the user a simplified view on the state of the processes.
The possible statuses are defined in
Status. The status rules are: - the initial status isDONE, - the statusRUNNINGorLINEARIZINGcan only be set when the current one isDONE,the status
DONEcan only be set when the current one isRUNNING.
Helper methods should be used to handle the statuses when running or linearizing a process:
run()andlinearize().Observers can be attached and are notified when the value of the status is changed. The observers are not restored after pickling.
Initialize self. See help(type(self)) for accurate signature.
- Parameters:
process_name (str) -- The name of the process.
- class Status(value)[source]#
Bases:
StrEnumThe statuses.
- DONE = 'DONE'#
- FAILED = 'FAILED'#
- LINEARIZING = 'LINEARIZING'#
- RUNNING = 'RUNNING'#
- add_observer(observer)[source]#
Add an observer.
- Parameters:
observer (BaseExecutionStatusObserver) -- The observer to add.
- Return type:
None
- linearize()[source]#
Set the status to
LINEARIZINGwhile executing code.On exception, the status is set to
FAILED, otherwise is set toDONE.- Return type:
Iterator[None]
- remove_observer(observer)[source]#
Remove an observer.
- Parameters:
observer (BaseExecutionStatusObserver) -- The observer to remove.
- Return type:
None