minos.saga.executions.executors.request module¶
- class minos.saga.executions.executors.request.RequestExecutor(*args, user, broker_publisher=<dependency_injector.wiring.Provide object>, **kwargs)[source]¶
Bases:
minos.saga.executions.executors.abc.Executor
Request Executor class.
This class has the responsibility to publish command on the corresponding broker’s queue.
- __init__(*args, user, broker_publisher=<dependency_injector.wiring.Provide object>, **kwargs)[source]¶
- async exec(operation, context)[source]¶
Exec method, that perform the publishing logic run an pre-callback function to generate the command contents.
- Parameters
operation (
typing.Optional
[minos.saga.definitions.operations.SagaOperation
[collections.abc.Callable
[minos.saga.context.SagaContext
, …,typing.Union
[minos.saga.messages.SagaRequest
,typing.Awaitable
[minos.saga.messages.SagaRequest
]]]]]) – Operation to be executed.context (
minos.saga.context.SagaContext
) – Execution context.
- Return type
- Returns
A saga context instance.
- async exec_function(func, *args, **kwargs)¶
Execute a function.
- Parameters
func (
typing.Callable
) – Function to be executed.args – Additional positional arguments to the function.
kwargs – Additional named arguments to the function.
- Return type
typing.Any
- Returns
The
func
result.