minos.saga.executions.steps.abc
Classes
Saga Step Execution class. |
- class SagaStepExecution[source]
Bases:
ABC
Saga Step Execution class.
- __init__(definition, related_services=None, status=SagaStepStatus.Created, already_rollback=False)[source]
- classmethod from_raw(raw, **kwargs)[source]
Build a new instance from a raw representation.
- Parameters
raw (Union[dict[str, Any], SagaStepExecution]) – The raw representation of the instance.
kwargs – Additional named arguments.
- Returns
A
SagaStepExecution
instance.- Return type
- static from_definition(step)[source]
Build a
SagaStepExecution
instance from theSagaStep
definition.- Parameters
step (SagaStep) – The
SagaStep
definition.- Returns
A new
SagaStepExecution
.- Return type
- abstract async execute(context, *args, **kwargs)[source]
Execution the step.
- Parameters
context (SagaContext) – The execution context to be used during the execution.
args – Additional positional arguments.
kwargs – Additional named arguments.
- Returns
The updated context.
- Return type
- abstract async rollback(context, *args, **kwargs)[source]
Revert the executed step.
- Parameters
context (SagaContext) – Execution context.
args – Additional positional arguments.
kwargs – Additional named arguments.
- Returns
The updated execution context.
- Return type