minos.saga.executions.steps.conditional

Classes

ConditionalSagaStepExecution

Conditional Saga Step Execution class.

class ConditionalSagaStepExecution[source]

Bases: SagaStepExecution

Conditional Saga Step Execution class.

definition: ConditionalSagaStep
__init__(*args, inner=None, **kwargs)[source]
Parameters

inner (Optional[SagaExecution]) –

inner: Optional[SagaExecution]
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

SagaContext

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

SagaContext

property raw: dict[str, Any]

Compute a raw representation of the instance.

Returns

A dict instance.

static from_definition(step)

Build a SagaStepExecution instance from the SagaStep definition.

Parameters

step (SagaStep) – The SagaStep definition.

Returns

A new SagaStepExecution.

Return type

SagaStepExecution

classmethod from_raw(raw, **kwargs)

Build a new instance from a raw representation.

Parameters
Returns

A SagaStepExecution instance.

Return type

SagaStepExecution