He-Pin commented on code in PR #3682:
URL: https://github.com/apache/pekko/pull/3682#discussion_r4366758779
##########
persistence-typed/src/main/scala/org/apache/pekko/persistence/typed/state/scaladsl/Effect.scala:
##########
@@ -196,3 +197,30 @@ trait EffectBuilder[+State] extends Effect[State] {
*/
def thenUnstashAll(): ReplyEffect[State]
}
+
+/**
+ * A reply decision that can be followed by stopping the actor.
+ * Returned by `reply`, `noReply`, `thenReply`, and `thenNoReply`.
+ * Stashing returns the base [[ReplyEffect]], which does not allow `thenStop`.
+ *
+ * Not intended for user extension.
+ *
+ * @since 2.0.0
+ */
+@DoNotInherit trait ReplyEffectWithStop[+State] extends ReplyEffect[State] {
+
+ /**
+ * Stop the actor after executing the preceding side effects.
+ * Commands remaining in the stash from earlier commands are discarded when
the actor stops.
+ *
+ * @since 2.0.0
+ */
+ def thenStop(): ReplyEffectWithStop[State]
+
+ /**
+ * Unstash previously stashed commands, retaining the ability to append
`thenStop`.
+ *
+ * @since 2.0.0
+ */
+ override def thenUnstashAll(): ReplyEffectWithStop[State]
Review Comment:
Will change to self type
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]