minos.saga.executions.steps.local

Classes

LocalSagaStepExecution

Local Saga Step Execution class.

class LocalSagaStepExecution[source]

Bases: SagaStepExecution

Local Saga Step Execution class.

definition: minos.saga.definitions.steps.local.LocalSagaStep
async execute(context, *args, **kwargs)[source]

Execute the local saga step.

Parameters
  • context (SagaContext) – The execution context.

  • args – Additional positional arguments.

  • kwargs – Additional named arguments.

Returns

The new saga context.

Return type

SagaContext

async rollback(context, *args, **kwargs)[source]

Rollback the local saga context.

Parameters
  • context (SagaContext) – The execution context.

  • args – Additional positional arguments.

  • kwargs – Additional named arguments.

Returns

The new saga context.

Return type

SagaContext

__init__(definition, related_services=None, status=SagaStepStatus.Created, already_rollback=False)
Parameters
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

property raw: dict[str, Any]

Compute a raw representation of the instance.

Returns

A dict instance.