Class DurableStateBehavior$
- java.lang.Object
-
- org.apache.pekko.persistence.typed.state.scaladsl.DurableStateBehavior$
-
public class DurableStateBehavior$ extends java.lang.ObjectAPI May Change
-
-
Field Summary
Fields Modifier and Type Field Description static DurableStateBehavior$MODULE$Static reference to the singleton instance of this Scala object.
-
Constructor Summary
Constructors Constructor Description DurableStateBehavior$()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <Command,State>
DurableStateBehavior<Command,State>apply(PersistenceId persistenceId, State emptyState, scala.Function2<State,Command,Effect<State>> commandHandler)Create aBehaviorfor a persistent actor with durable storage of its state.longlastSequenceNumber(ActorContext<?> context)The last sequence number that was persisted, can only be called from inside the handlers of aDurableStateBehavior<Command,State>
DurableStateBehavior<Command,State>withEnforcedReplies(PersistenceId persistenceId, State emptyState, scala.Function2<State,Command,ReplyEffect<State>> commandHandler)Create aBehaviorfor a persistent actor that is enforcing that replies to commands are not forgotten.
-
-
-
Field Detail
-
MODULE$
public static final DurableStateBehavior$ MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Method Detail
-
apply
public <Command,State> DurableStateBehavior<Command,State> apply(PersistenceId persistenceId, State emptyState, scala.Function2<State,Command,Effect<State>> commandHandler)
Create aBehaviorfor a persistent actor with durable storage of its state.- Parameters:
persistenceId- stable unique identifier for theDurableStateBehavioremptyState- the intial state for the entity before any state has been storedcommandHandler- map commands to effects e.g. persisting state, replying to commands
-
withEnforcedReplies
public <Command,State> DurableStateBehavior<Command,State> withEnforcedReplies(PersistenceId persistenceId, State emptyState, scala.Function2<State,Command,ReplyEffect<State>> commandHandler)
Create aBehaviorfor a persistent actor that is enforcing that replies to commands are not forgotten. Then there will be compilation errors if the returned effect isn't aReplyEffect, which can be created withEffect.reply,Effect.noReply,EffectBuilder.thenReply, orEffectBuilder.thenNoReply.
-
lastSequenceNumber
public long lastSequenceNumber(ActorContext<?> context)
The last sequence number that was persisted, can only be called from inside the handlers of aDurableStateBehavior
-
-