He-Pin commented on code in PR #1459:
URL: https://github.com/apache/pekko/pull/1459#discussion_r1739979730
##########
actor-typed/src/main/scala/org/apache/pekko/actor/typed/scaladsl/Behaviors.scala:
##########
@@ -269,6 +280,19 @@ object Behaviors {
def withTimers[T](factory: TimerScheduler[T] => Behavior[T]): Behavior[T] =
TimerSchedulerImpl.withTimers(factory)
+ /**
+ * Support for scheduled `self` messages in an actor.
+ * It takes care of the lifecycle of the timers such as cancelling them when
the actor
+ * is restarted or stopped.
+ *
+ * @see [[TimerScheduler]]
+ * @since 1.1.0
+ */
+ def withTimersSetup[T](factory: (TimerScheduler[T], ActorContext[T]) =>
Behavior[T]): Behavior[T] =
+ setup(ctx => {
+ TimerSchedulerImpl.withTimers(factory(_, ctx))
+ })
Review Comment:
It was timer box setup but not now.
--
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]