Package akka.persistence.typed.scaladsl
Class EventSourcedBehavior$
- java.lang.Object
-
- akka.persistence.typed.scaladsl.EventSourcedBehavior$
-
public class EventSourcedBehavior$ extends java.lang.Object
Type alias for the command handler function that defines how to act on commands.The type alias is not used in API signatures because it's easier to see (in IDE) what is needed when full function type is used. When defining the handler as a separate function value it can be useful to use the alias for shorter type signature.
-
-
Field Summary
Fields Modifier and Type Field Description static EventSourcedBehavior$
MODULE$
Static reference to the singleton instance of this Scala object.
-
Constructor Summary
Constructors Constructor Description EventSourcedBehavior$()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <Command,Event,State>
EventSourcedBehavior<Command,Event,State>apply(PersistenceId persistenceId, State emptyState, scala.Function2<State,Command,Effect<Event,State>> commandHandler, scala.Function2<State,Event,State> eventHandler)
Create aBehavior
for a persistent actor.long
lastSequenceNumber(ActorContext<?> context)
<Command extends ExpectingReply<?>,Event,State>
EventSourcedBehavior<Command,Event,State>withEnforcedReplies(PersistenceId persistenceId, State emptyState, scala.Function2<State,Command,ReplyEffect<Event,State>> commandHandler, scala.Function2<State,Event,State> eventHandler)
Create aBehavior
for a persistent actor that is enforcing that replies to commands are not forgotten.
-
-
-
Field Detail
-
MODULE$
public static final EventSourcedBehavior$ MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Method Detail
-
apply
public <Command,Event,State> EventSourcedBehavior<Command,Event,State> apply(PersistenceId persistenceId, State emptyState, scala.Function2<State,Command,Effect<Event,State>> commandHandler, scala.Function2<State,Event,State> eventHandler)
Create aBehavior
for a persistent actor.- Parameters:
persistenceId
- (undocumented)emptyState
- (undocumented)commandHandler
- (undocumented)eventHandler
- (undocumented)- Returns:
- (undocumented)
-
withEnforcedReplies
public <Command extends ExpectingReply<?>,Event,State> EventSourcedBehavior<Command,Event,State> withEnforcedReplies(PersistenceId persistenceId, State emptyState, scala.Function2<State,Command,ReplyEffect<Event,State>> commandHandler, scala.Function2<State,Event,State> eventHandler)
Create aBehavior
for 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
,Effect.thenReply
, orEffect.thenNoReply
.- Parameters:
persistenceId
- (undocumented)emptyState
- (undocumented)commandHandler
- (undocumented)eventHandler
- (undocumented)- Returns:
- (undocumented)
-
lastSequenceNumber
public long lastSequenceNumber(ActorContext<?> context)
-
-