Saga<'TData, 'TState, 'TEvent>Type
PackageFCQRS
C#-friendly abstract base for a saga, the counterpart of the F# Saga definition. A concrete
saga supplies SagaName, InitialData, Originator, StartsOn, Start, HandleEvent and
ApplySideEffects; the base provides the wiring (Init/Factory) and the small transition DSL.
TData is data the saga carries in every state, TState its states, and TEvent the event type
of the originator, the aggregate whose stored event starts the saga.
Designed to be subclassed from C#.
Specification
Kind
Type
Members
18
Examples
0
``.ctor``Signature
Saga()
ApplySideEffectsSignature
this.ApplySideEffects
FactorySignature
this.Factory
FactorySignature
this.Factory
HandleEventSignature
this.HandleEvent
Summary
| Name | Signature | Synopsis |
|---|---|---|
| ``.ctor`` | Saga() | No description available. |
| ApplySideEffects | this.ApplySideEffects | Returns the transition and commands for a stored state. |
| Factory | this.Factory | The factory the saga-starter spawns instances from. |
| Factory | this.Factory | The factory the saga-starter spawns instances from, with an explicit policy. |
| HandleEvent | this.HandleEvent | Handles a message once the saga has a state: events from the aggregates it sends commands to, ExpectationExhausted, and the saga's own ToSelf messages. |
| Init | this.Init | Register the saga; calling this IS the registration. |
| Init | this.Init | Register the saga with an explicit (already-resolved) snapshot policy. |
| Start | this.Start | Handles a message that arrives before the saga has a state: normally the event that started it. |
| StartsOn | this.StartsOn | Whether a stored originator event starts an instance of this saga. |
| Originator | this.Originator | The aggregate whose stored event starts the saga, and the target of ToOriginator. |
| SnapshotPolicy | this.SnapshotPolicy | Per-saga snapshot cadence. |
| SagaName | this.SagaName | The saga's stored name, like an aggregate's EntityName. |
| InitialData | this.InitialData | No description available. |
| NextState | Saga.NextState(next) | No description available. |
| StateChanged | Saga.StateChanged(next) | Transition and event DSL over TState. |
| Stay | Saga.Stay() | No description available. |
| StopSaga | Saga.StopSaga() | No description available. |
| Unhandled | Saga.Unhandled() | No description available. |
Returns the transition and commands for a stored state. It runs again after recovery;
the bool says whether the saga is recovering.
Parameters
| Name | Type | Description |
|---|---|---|
| arg0 | SagaState<'TData, 'TState> | |
| arg1 | bool |
Returns
SagaSideEffectResult<'TState>
The factory the saga-starter spawns instances from.
Parameters
| Name | Type | Description |
|---|---|---|
| actorApi | IActor |
Returns
AggregateFactory
The factory the saga-starter spawns instances from, with an explicit policy.
Parameters
| Name | Type | Description |
|---|---|---|
| actorApi | IActor | |
| snapshotPolicy | SnapshotPolicy |
Returns
AggregateFactory
Handles a message once the saga has a state: events from the aggregates it sends commands
to, ExpectationExhausted, and the saga's own ToSelf messages.
Parameters
| Name | Type | Description |
|---|---|---|
| arg0 | obj | |
| arg1 | SagaState<'TData, 'TState> |
Returns
EventAction<'TState>
Register the saga; calling this IS the registration.
Parameters
| Name | Type | Description |
|---|---|---|
| actorApi | IActor |
Returns
EntityFac<obj>
Register the saga with an explicit (already-resolved) snapshot policy.
Parameters
| Name | Type | Description |
|---|---|---|
| actorApi | IActor | |
| snapshotPolicy | SnapshotPolicy |
Returns
EntityFac<obj>
Handles a message that arrives before the saga has a state: normally the event that
started it. Return StateChanged with the first state, or Unhandled.
Parameters
| Name | Type | Description |
|---|---|---|
| arg0 | obj | |
| arg1 | 'TData |
Returns
EventAction<'TState>
Whether a stored originator event starts an instance of this saga.
Parameters
| Name | Type | Description |
|---|---|---|
| arg0 | Event<'TEvent> |
Returns
bool
The aggregate whose stored event starts the saga, and the target of ToOriginator.
Returns
AggregateFactory
Per-saga snapshot cadence. Override to use Every(n) or NoSnapshots;
the default falls back to config:akka:persistence:snapshot-version-count (or 30).
Returns
SnapshotPolicy
The saga's stored name, like an aggregate's EntityName. Changing it orphans stored sagas.
Returns
string
Parameters
| Name | Type | Description |
|---|---|---|
| next | 'TState |
Returns
SagaTransition<'TState>
Transition and event DSL over TState.
Parameters
| Name | Type | Description |
|---|---|---|
| next | 'TState |
Returns
EventAction<'TState>