Package akka.persistence.typed.internal
Class EffectImpl<Event,State>
- java.lang.Object
-
- akka.persistence.typed.javadsl.EffectBuilder<Event,State>
-
- akka.persistence.typed.internal.EffectImpl<Event,State>
-
- All Implemented Interfaces:
Effect<Event,State>
,ReplyEffect<Event,State>
,Effect<Event,State>
,EffectBuilder<Event,State>
,ReplyEffect<Event,State>
- Direct Known Subclasses:
CompositeEffect
,Persist
,PersistAll
,PersistNothing$
,Stash$
,Unhandled$
public abstract class EffectImpl<Event,State> extends EffectBuilder<Event,State> implements ReplyEffect<Event,State>, ReplyEffect<Event,State>, EffectBuilder<Event,State>
INTERNAL API
-
-
Constructor Summary
Constructors Constructor Description EffectImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description scala.collection.immutable.Seq<Event>
events()
EffectImpl<Event,State>
thenNoReply()
WhenEventSourcedBehaviorWithEnforcedReplies
is used there will be compilation errors if the returned effect isn't aReplyEffect
.<ReplyMessage>
EffectImpl<Event,State>thenReply(ExpectingReply<ReplyMessage> cmd, scala.Function1<State,ReplyMessage> replyWithMessage)
Send a reply message to the command, which implementsExpectingReply
.EffectImpl<Event,State>
thenRun(scala.Function1<State,scala.runtime.BoxedUnit> chainedEffect)
Run the given callback.EffectImpl<Event,State>
thenStop()
The side effect is to stop the actorEffectImpl<Event,State>
thenUnstashAll()
Unstash the commands that were stashed withEffectFactories.stash
.-
Methods inherited from class akka.persistence.typed.javadsl.EffectBuilder
thenReply, thenRun, thenRun
-
-
-
-
Method Detail
-
events
public scala.collection.immutable.Seq<Event> events()
- Specified by:
events
in interfaceEffectBuilder<Event,State>
-
thenNoReply
public EffectImpl<Event,State> thenNoReply()
Description copied from class:EffectBuilder
WhenEventSourcedBehaviorWithEnforcedReplies
is used there will be compilation errors if the returned effect isn't aReplyEffect
. ThisthenNoReply
can be used as a conscious decision that a reply shouldn't be sent for a specific command or the reply will be sent later.- Specified by:
thenNoReply
in interfaceEffectBuilder<Event,State>
- Specified by:
thenNoReply
in classEffectBuilder<Event,State>
- Returns:
- (undocumented)
-
thenReply
public <ReplyMessage> EffectImpl<Event,State> thenReply(ExpectingReply<ReplyMessage> cmd, scala.Function1<State,ReplyMessage> replyWithMessage)
Description copied from interface:EffectBuilder
Send a reply message to the command, which implementsExpectingReply
. The type of the reply message must conform to the type specified inExpectingReply.replyTo
ActorRef
.This has the same semantics as
cmd.replyTo.tell
.It is provided as a convenience (reducing boilerplate) and a way to enforce that replies are not forgotten when the
EventSourcedBehavior
is created withEventSourcedBehavior.withEnforcedReplies
. WhenwithEnforcedReplies
is used there will be compilation errors if the returned effect isn't aReplyEffect
. The reply message will be sent also ifwithEnforcedReplies
isn't used, but then the compiler will not help finding mistakes.- Specified by:
thenReply
in interfaceEffectBuilder<Event,State>
- Parameters:
cmd
- (undocumented)replyWithMessage
- (undocumented)- Returns:
- (undocumented)
-
thenRun
public EffectImpl<Event,State> thenRun(scala.Function1<State,scala.runtime.BoxedUnit> chainedEffect)
Description copied from interface:EffectBuilder
Run the given callback. Callbacks are run sequentially.- Specified by:
thenRun
in interfaceEffectBuilder<Event,State>
- Parameters:
chainedEffect
- (undocumented)- Returns:
- (undocumented)
-
thenStop
public EffectImpl<Event,State> thenStop()
Description copied from class:EffectBuilder
The side effect is to stop the actor- Specified by:
thenStop
in interfaceEffectBuilder<Event,State>
- Specified by:
thenStop
in classEffectBuilder<Event,State>
-
thenUnstashAll
public EffectImpl<Event,State> thenUnstashAll()
Description copied from class:EffectBuilder
Unstash the commands that were stashed withEffectFactories.stash
.It's allowed to stash messages while unstashing. Those newly added commands will not be processed by this
unstashAll
effect and have to be unstashed by anotherunstashAll
.- Specified by:
thenUnstashAll
in interfaceEffectBuilder<Event,State>
- Specified by:
thenUnstashAll
in interfaceReplyEffect<Event,State>
- Specified by:
thenUnstashAll
in interfaceReplyEffect<Event,State>
- Specified by:
thenUnstashAll
in classEffectBuilder<Event,State>
- Returns:
- (undocumented)
-
-