minos.saga.executions.steps.remote

Classes

RemoteSagaStepExecution

Saga Execution Step class.

class RemoteSagaStepExecution[source]

Bases: SagaStepExecution

Saga Execution Step class.

definition: minos.saga.definitions.steps.remote.RemoteSagaStep
async execute(context, response=None, *args, **kwargs)[source]

Execution the remote step.

Parameters
  • context (SagaContext) – The execution context to be used during the execution.

  • response (Optional[SagaResponse]) – An optional command response instance (to be consumed by the on_success method).

  • args – Additional positional arguments.

  • kwargs – Additional named arguments.

Returns

The updated context.

Return type

SagaContext

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

Revert the executed remote step.

Parameters
  • context (SagaContext) – Execution context.

  • args – Additional positional arguments.

  • kwargs – Additional named arguments.

Returns

The updated execution 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.