Class PersistentFSM<TState, TData, TEvent>
Finite state machine (FSM) persistent actor.
Implements
Inherited Members
Namespace: Akka.Persistence.Fsm
Assembly: Akka.Persistence.dll
Syntax
public abstract class PersistentFSM<TState, TData, TEvent> : PersistentFSMBase<TState, TData, TEvent>, IInternalActor, IPersistentIdentity, IPersistenceStash, IWithUnboundedStash, IWithUnrestrictedStash, IActorStash, IRequiresMessageQueue<IUnboundedDequeBasedMessageQueueSemantics>, IPersistenceRecovery, IListeners where TState : PersistentFSM.IFsmState
Type Parameters
Name | Description |
---|---|
TState | The state name type |
TData | The state data type |
TEvent | The event data type |
Methods
| Improve this Doc View SourceApplyEvent(TEvent, TData)
Override this handler to define the action on Domain Event
Declaration
protected abstract TData ApplyEvent(TEvent domainEvent, TData currentData)
Parameters
Type | Name | Description |
---|---|---|
TEvent | domainEvent | Domain event to apply. |
TData | currentData | State data of the previous state. |
Returns
Type | Description |
---|---|
TData | Updated state data |
ApplyState(PersistentFSM.State<TState, TData, TEvent>)
Persist FSM State and FSM State Data
Declaration
protected override void ApplyState(PersistentFSM.State<TState, TData, TEvent> nextState)
Parameters
Type | Name | Description |
---|---|---|
PersistentFSM.State<TState, TData, TEvent> | nextState | TBD |
Overrides
OnRecoveryCompleted()
Override this handler to define the action on recovery completion
Declaration
protected virtual void OnRecoveryCompleted()
ReceiveRecover(Object)
Recovery handler that receives persistent events during recovery. If a state snapshot has been captured and saved, this handler will receive a SnapshotOffer message followed by events that are younger than offer itself.
This handler must not have side-effects other than changing persistent actor state i.e. it should not perform actions that may fail, such as interacting with external services, for example.
If there is a problem with recovering the state of the actor from the journal, the error will be logged and the actor will be stopped.
Declaration
protected override bool ReceiveRecover(object message)
Parameters
Type | Name | Description |
---|---|---|
Object | message | TBD |
Returns
Type | Description |
---|---|
Boolean | TBD |
Overrides
| Improve this Doc View SourceSaveStateSnapshot()
Save the current state as a snapshot
Declaration
public void SaveStateSnapshot()