AbstractDurableStateActor
in package
AbstractYes
Class-based OOP alternative to the functional DurableStateBehavior API.
Users extend this class and override abstract methods to define their domain logic. The actor delegates to DurableStateEngine::create() for recovery and persistence handling.
Tags
Table of Contents
Methods
- __construct() : mixed
- emptyState() : S
- The initial empty state before any state has been persisted.
- handleCommand() : DurableEffect
- Handle a command and return a DurableEffect describing what should happen.
- persistenceId() : PersistenceId
- The unique persistence identity for this actor.
- toBehavior() : Behavior
- Build a Behavior by delegating to DurableStateEngine::create().
- toProps() : Props
- Build Props from the behavior, ready for spawning.
- withWriterId() : static
Methods
__construct()
public
__construct(DurableStateStore $stateStore) : mixed
Parameters
- $stateStore : DurableStateStore
emptyState()
The initial empty state before any state has been persisted.
public
abstract emptyState() : S
Return values
ShandleCommand()
Handle a command and return a DurableEffect describing what should happen.
public
abstract handleCommand(S $state, ActorContext $ctx, object $command) : DurableEffect
Parameters
- $state : S
- $ctx : ActorContext
- $command : object
Return values
DurableEffectpersistenceId()
The unique persistence identity for this actor.
public
abstract persistenceId() : PersistenceId
Return values
PersistenceIdtoBehavior()
Build a Behavior by delegating to DurableStateEngine::create().
public
toBehavior() : Behavior
Return values
BehaviortoProps()
Build Props from the behavior, ready for spawning.
public
toProps() : Props
Return values
PropswithWriterId()
public
withWriterId(Ulid $writerId) : static
Parameters
- $writerId : Ulid