minos.saga.executions.steps.abc
Classes
Saga Step Execution class. |
- class SagaStepExecution[source]
Bases:
ABCSaga 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
SagaStepExecutioninstance.- Return type
- static from_definition(step)[source]
Build a
SagaStepExecutioninstance from theSagaStepdefinition.- Parameters
step (SagaStep) – The
SagaStepdefinition.- 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