minos.saga.definitions.steps.remote
Classes
Remote Saga Step class. |
- class RemoteSagaStep[source]
Bases:
SagaStep
Remote Saga Step class.
- __init__(on_execute=None, on_success=None, on_error=None, on_failure=None, **kwargs)[source]
- Parameters
on_execute (Optional[Union[Callable[[SagaContext, ...], Union[SagaRequest, Awaitable[SagaRequest]]], SagaOperation[Callable[[SagaContext, ...], Union[SagaRequest, Awaitable[SagaRequest]]]]]]) –
on_success (Optional[Union[Callable[[SagaContext, SagaResponse, ...], Union[Exception, SagaContext, Awaitable[Union[Exception, SagaContext]]]], SagaOperation[Callable[[SagaContext, SagaResponse, ...], Union[Exception, SagaContext, Awaitable[Union[Exception, SagaContext]]]]]]]) –
on_error (Optional[Union[Callable[[SagaContext, SagaResponse, ...], Union[Exception, SagaContext, Awaitable[Union[Exception, SagaContext]]]], SagaOperation[Callable[[SagaContext, SagaResponse, ...], Union[Exception, SagaContext, Awaitable[Union[Exception, SagaContext]]]]]]]) –
on_failure (Optional[Union[Callable[[SagaContext, ...], Union[SagaRequest, Awaitable[SagaRequest]]], SagaOperation[Callable[[SagaContext, ...], Union[SagaRequest, Awaitable[SagaRequest]]]]]]) –
- on_execute(callback, parameters=None, **kwargs)[source]
On execute method.
- Parameters
callback (Callable[[SagaContext, ...], Union[SagaRequest, Awaitable[SagaRequest]]]) – The callback function to be called.
parameters (Optional[SagaContext]) – A mapping of named parameters to be passed to the callback.
kwargs – A set of named arguments to be passed to the callback.
parameters
has priority if it is notNone
.
- Returns
A
self
reference.- Return type
- on_failure(callback, parameters=None, **kwargs)[source]
On failure method.
- Parameters
callback (Callable[[SagaContext, ...], Union[SagaRequest, Awaitable[SagaRequest]]]) – The callback function to be called.
parameters (Optional[SagaContext]) – A mapping of named parameters to be passed to the callback.
kwargs – A set of named arguments to be passed to the callback.
parameters
has priority if it is notNone
.
- Returns
A
self
reference.- Return type
- on_success(callback, parameters=None, **kwargs)[source]
On success method.
- Parameters
callback (Callable[[SagaContext, SagaResponse, ...], Union[Exception, SagaContext, Awaitable[Union[Exception, SagaContext]]]]) – The callback function to be called.
parameters (Optional[SagaContext]) – A mapping of named parameters to be passed to the callback.
kwargs – A set of named arguments to be passed to the callback.
parameters
has priority if it is notNone
.
- Returns
A
self
reference.- Return type
- on_error(callback, parameters=None, **kwargs)[source]
On error method.
- Parameters
callback (Callable[[SagaContext, SagaResponse, ...], Union[Exception, SagaContext, Awaitable[Union[Exception, SagaContext]]]]) – The callback function to be called.
parameters (Optional[SagaContext]) – A mapping of named parameters to be passed to the callback.
kwargs – A set of named arguments to be passed to the callback.
parameters
has priority if it is notNone
.
- Returns
A
self
reference.- Return type
- validate()[source]
Check if the step is valid.
- Returns
This method does not return anything, but raises an exception if the step is not valid.
- Return type
None
- property raw: dict[str, Any]
Generate a raw representation of the instance.
- Returns
A
dict
instance.
- commit(*args, **kwargs)
Commit the current
SagaStep
on theSaga
.- Parameters
args – Additional positional arguments.
kwargs – Additional named arguments.
- Returns
A
Saga
instance.- Return type
- conditional_step(*args, **kwargs)
Create a new conditional step in the
Saga
.- Parameters
args – Additional positional parameters.
kwargs – Additional named parameters.
- Returns
A new
SagaStep
instance.- Return type
- classmethod from_raw(raw, **kwargs)
Build a new instance from raw.
- local_step(*args, **kwargs)
Create a new local step in the
Saga
.- Parameters
args – Additional positional parameters.
kwargs – Additional named parameters.
- Returns
A new
SagaStep
instance.- Return type
- remote_step(*args, **kwargs)
Create a new remote step in the
Saga
.- Parameters
args – Additional positional parameters.
kwargs – Additional named parameters.
- Returns
A new
SagaStep
instance.- Return type