minos.saga.manager module¶
- class minos.saga.manager.SagaManager(storage, broker_pool=<dependency_injector.wiring.Provide object>, *args, **kwargs)[source]¶
Bases:
minos.common.setup.MinosSetupSaga Manager implementation class.
The purpose of this class is to manage the running process for new or paused``SagaExecution`` instances.
- __init__(storage, broker_pool=<dependency_injector.wiring.Provide object>, *args, **kwargs)[source]¶
- property already_destroyed: bool¶
Already Destroy getter.
- Return type
bool- Returns
A boolean value.
- property already_setup: bool¶
Already Setup getter.
- Return type
bool- Returns
A boolean value.
- async destroy()¶
Destroy miscellaneous repository things.
- Return type
None- Returns
This method does not return anything.
- classmethod from_config(config=None, **kwargs)¶
Build a new instance from config.
- Parameters
config (
typing.Union[minos.common.configuration.config.MinosConfig,pathlib.Path,None]) – Config instance. If None is provided, default config is chosen.kwargs – Additional named arguments.
- Return type
~S
- Returns
A instance of the called class.
- 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 (
typing.Optional[minos.saga.definitions.saga.Saga]) – Saga definition to be executed.context (
typing.Optional[minos.saga.context.SagaContext]) – Initial context to be used during the execution. (Only used for new executions)response (
typing.Optional[minos.saga.messages.SagaResponse]) – The reply that relaunches a saga execution.user (
typing.Optional[uuid.UUID]) – The user identifier to be injected on remote steps.autocommit (
bool) – IfTruethe transactions are committed/rejected automatically. Otherwise, thecommitorrejectmust to be called manually.pause_on_disk (
bool) – IfTruethe 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) – IfTrueexceptions are raised on error. Otherwise, the execution is returned normally but withErroredstatus.return_execution (
bool) – IfTruetheSagaExecutioninstance is returned. Otherwise, only the identifier (UUID) is returned.kwargs – Additional named arguments.
- Return type
typing.Union[uuid.UUID,minos.saga.executions.saga.SagaExecution]- Returns
This method does not return anything.
- async setup()¶
Setup miscellaneous repository things.
- Return type
None- Returns
This method does not return anything.