minos.saga.executions.steps.conditional module¶
- class minos.saga.executions.steps.conditional.ConditionalSagaStepExecution(*args, inner=None, **kwargs)[source]¶
Bases:
minos.saga.executions.steps.abc.SagaStepExecutionConditional Saga Step Execution class.
- definition: ConditionalSagaStep¶
- async execute(context, *args, **kwargs)[source]¶
Execution the step.
- Parameters
context (
minos.saga.context.SagaContext) – The execution context to be used during the execution.args – Additional positional arguments.
kwargs – Additional named arguments.
- Return type
- Returns
The updated context.
- static from_definition(step)¶
Build a
SagaStepExecutioninstance from theSagaStepdefinition.- Parameters
step (
minos.saga.definitions.steps.abc.SagaStep) – TheSagaStepdefinition.- Return type
- Returns
A new
SagaStepExecution.
- classmethod from_raw(raw, **kwargs)¶
Build a new instance from a raw representation.
- Parameters
raw (
typing.Union[dict[str,typing.Any],minos.saga.executions.steps.abc.SagaStepExecution]) – The raw representation of the instance.kwargs – Additional named arguments.
- Return type
- Returns
A
SagaStepExecutioninstance.
- inner: Optional[SagaExecution]¶
- property raw: dict[str, typing.Any]¶
Compute a raw representation of the instance.
- Return type
dict[str,typing.Any]- Returns
A
dictinstance.
- async rollback(context, *args, **kwargs)[source]¶
Revert the executed step.
- Parameters
context (
minos.saga.context.SagaContext) – Execution context.args – Additional positional arguments.
kwargs – Additional named arguments.
- Return type
- Returns
The updated execution context.