pynenc.invocation.status¶
Module Contents¶
Classes¶
An enumeration representing the status of a task invocation. |
API¶
- class pynenc.invocation.status.InvocationStatus[source]¶
Bases:
enum.StrEnumAn enumeration representing the status of a task invocation.
The PENDING status will expire after the time specified in
- Attr:
~pynenc.conf.config_pynenc.ConfigPynenc.max_pending_seconds.
Note
FAILED, RETRY, and SUCCESS are the same category and can be considered as subtypes of a hypothetical TERMINATED status.
- Variables:
REGISTERED – The task call has been routed and is registered.
REROUTED – The task call has been re-routed and is registered. This status is used when a registered task cannot be set to pending and then run in case of running concurrency checks (e.g., only one instance of the task can run at the same time).
PENDING – The task call was picked by a runner but is not yet executed. The status pending will expire after Config.max_pending_seconds.
RUNNING – The task call is currently running.
SUCCESS – The task call finished without errors.
PAUSED – The task call execution is paused.
SCHEDULED – A task has been registered to run at a specific time. This is a subtype of REGISTERED.
FAILED – The task call finished with exceptions.
RETRY – The task call finished with a retriable exception.
Initialization
Initialize self. See help(type(self)) for accurate signature.
- REGISTERED¶
‘auto(…)’
- REROUTED¶
‘auto(…)’
- PENDING¶
‘auto(…)’
- RUNNING¶
‘auto(…)’
- SUCCESS¶
‘auto(…)’
- PAUSED¶
‘auto(…)’
- SCHEDULED¶
‘auto(…)’
- FAILED¶
‘auto(…)’
- RETRY¶
‘auto(…)’
- is_available_for_run() bool[source]¶
Check if the task is in a state where it is available to be picked up and run by any broker. This means the task is not currently being executed, paused, or about to be executed by any other broker.
- Returns:
True if the status is runnable by any broker, False otherwise.
- is_final() bool[source]¶
Checks if the status is a final status.
- Returns:
True if the status is final, False otherwise.
- classmethod get_final_statuses() set[pynenc.invocation.status.InvocationStatus][source]¶
Returns the set of statuses that are considered final.
- Returns:
A set containing all final statuses