minos.saga.manager
Classes
- class SagaManager[source]
Bases:
SagaManager
,InjectableMixin
- __init__(storage, broker_pool=None, pool_factory=None, *args, **kwargs)[source]
- Parameters
storage (SagaExecutionRepository) –
broker_pool (Optional[BrokerClientPool]) –
pool_factory (Optional[PoolFactory]) –
- 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, thecommit
orreject
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 withErrored
status.return_execution (bool) – If
True
theSagaExecution
instance is returned. Otherwise, only the identifier (UUID
) is returned.kwargs – Additional named arguments.
- Returns
This method does not return anything.
- Return type
- 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
- async setup()
Setup miscellaneous repository things.
- Returns
This method does not return anything.
- Return type
None