minos.saga.manager

Classes

SagaManager

class SagaManager[source]

Bases: SagaManager, InjectableMixin

__init__(storage, broker_pool=None, pool_factory=None, *args, **kwargs)[source]
Parameters
async run(definition=None, context=None, *, response=None, user=None, autocommit=True, pause_on_disk=False, raise_on_error=True, return_execution=True, **kwargs)[source]

Perform a run of a Saga.

The run can be a new one (if a name is provided) or continue execution a previous one (if a reply is provided).

Parameters
  • definition (Optional[Saga]) – Saga definition to be executed.

  • context (Optional[SagaContext]) – Initial context to be used during the execution. (Only used for new executions)

  • response (Optional[SagaResponse]) – The reply that relaunches a saga execution.

  • user (Optional[UUID]) – The user identifier to be injected on remote steps.

  • autocommit (bool) – If True the transactions are committed/rejected automatically. Otherwise, the commit or reject must to be called manually.

  • pause_on_disk (bool) – If True the pauses until remote steps’ responses are paused on disk (background, non-blocking the execution). Otherwise, the pauses are waited on memory (online, blocking the execution)

  • raise_on_error (bool) – If True exceptions are raised on error. Otherwise, the execution is returned normally but with Errored status.

  • return_execution (bool) – If True the SagaExecution instance is returned. Otherwise, only the identifier (UUID) is returned.

  • kwargs – Additional named arguments.

Returns

This method does not return anything.

Return type

Union[UUID, SagaExecution]

property already_destroyed: bool

Already Destroy getter.

Returns

A boolean value.

property already_setup: bool

Already Setup getter.

Returns

A boolean value.

async destroy()

Destroy miscellaneous repository things.

Returns

This method does not return anything.

Return type

None

classmethod from_config(config=None, **kwargs)

Build a new instance from config.

Parameters
  • config (Optional[Union[Config, Path]]) – Config instance. If None is provided, default config is chosen.

  • kwargs – Additional named arguments.

Returns

A instance of the called class.

Return type

S

classmethod get_injectable_name()

Get the injectable name.

Returns

A str value.

Return type

str

async setup()

Setup miscellaneous repository things.

Returns

This method does not return anything.

Return type

None