minos.saga.definitions.steps.remote module¶
- class minos.saga.definitions.steps.remote.RemoteSagaStep(on_execute=None, on_success=None, on_error=None, on_failure=None, **kwargs)[source]¶
Bases:
minos.saga.definitions.steps.abc.SagaStepRemote Saga Step class.
- commit(*args, **kwargs)¶
Commit the current
SagaStepon theSaga.- Parameters
args – Additional positional arguments.
kwargs – Additional named arguments.
- Return type
- Returns
A
Sagainstance.
- conditional_step(*args, **kwargs)¶
Create a new conditional step in the
Saga.- Parameters
args – Additional positional parameters.
kwargs – Additional named parameters.
- Return type
- Returns
A new
SagaStepinstance.
- classmethod from_raw(raw, **kwargs)¶
Build a new instance from raw.
- Parameters
raw (
typing.Union[dict[str,typing.Any],minos.saga.definitions.steps.abc.SagaStep]) – A raw representation.kwargs – Additional named arguments.
- Return type
- Returns
A
SagaStepinstance.
- local_step(*args, **kwargs)¶
Create a new local step in the
Saga.- Parameters
args – Additional positional parameters.
kwargs – Additional named parameters.
- Return type
- Returns
A new
SagaStepinstance.
- on_error(callback, parameters=None, **kwargs)[source]¶
On error method.
- Parameters
callback (
collections.abc.Callable[minos.saga.context.SagaContext,minos.saga.messages.SagaResponse, …,typing.Union[Exception,minos.saga.context.SagaContext,typing.Awaitable[typing.Union[Exception,minos.saga.context.SagaContext]]]]) – The callback function to be called.parameters (
typing.Optional[minos.saga.context.SagaContext]) – A mapping of named parameters to be passed to the callback.kwargs – A set of named arguments to be passed to the callback.
parametershas priority if it is notNone.
- Return type
- Returns
A
selfreference.
- on_execute(callback, parameters=None, **kwargs)[source]¶
On execute method.
- Parameters
callback (
collections.abc.Callable[minos.saga.context.SagaContext, …,typing.Union[minos.saga.messages.SagaRequest,typing.Awaitable[minos.saga.messages.SagaRequest]]]) – The callback function to be called.parameters (
typing.Optional[minos.saga.context.SagaContext]) – A mapping of named parameters to be passed to the callback.kwargs – A set of named arguments to be passed to the callback.
parametershas priority if it is notNone.
- Return type
- Returns
A
selfreference.
- on_failure(callback, parameters=None, **kwargs)[source]¶
On failure method.
- Parameters
callback (
collections.abc.Callable[minos.saga.context.SagaContext, …,typing.Union[minos.saga.messages.SagaRequest,typing.Awaitable[minos.saga.messages.SagaRequest]]]) – The callback function to be called.parameters (
typing.Optional[minos.saga.context.SagaContext]) – A mapping of named parameters to be passed to the callback.kwargs – A set of named arguments to be passed to the callback.
parametershas priority if it is notNone.
- Return type
- Returns
A
selfreference.
- on_success(callback, parameters=None, **kwargs)[source]¶
On success method.
- Parameters
callback (
collections.abc.Callable[minos.saga.context.SagaContext,minos.saga.messages.SagaResponse, …,typing.Union[Exception,minos.saga.context.SagaContext,typing.Awaitable[typing.Union[Exception,minos.saga.context.SagaContext]]]]) – The callback function to be called.parameters (
typing.Optional[minos.saga.context.SagaContext]) – A mapping of named parameters to be passed to the callback.kwargs – A set of named arguments to be passed to the callback.
parametershas priority if it is notNone.
- Return type
- Returns
A
selfreference.
- property raw: dict[str, typing.Any]¶
Generate a raw representation of the instance.
- Return type
dict[str,typing.Any]- Returns
A
dictinstance.
- remote_step(*args, **kwargs)¶
Create a new remote step in the
Saga.- Parameters
args – Additional positional parameters.
kwargs – Additional named parameters.
- Return type
- Returns
A new
SagaStepinstance.
- step(*args, **kwargs)¶
Create a new step in the
Saga.- Parameters
args – Additional positional parameters.
kwargs – Additional named parameters.
- Return type
- Returns
A new
SagaStepinstance.