I am trying to schedule two events using the Akka scheduler. One of them using the context.system.scheduler.schedule(0 milliseconds, 100 milliseconds, receiver: ActorRef, message: Any)
and another using scheduleOnce(1 seconds, receiver: ActorRef, message: Any)
.
Both messages are passed to different receivers (the former to a persistence actor and the latter to client actor via self). I see that the scheduleOnce is never being executed. If I comment out the code for schedule
I can see scheduleOnce
being executed fine. Is there something in the scheduler which prevents multiple schedules from a single actor? I tried to cancel the cancellable from the former scheduler before performing the action when the message is received in the self from the second scheduler but that didn't help. I am at a loss here. Any thoughts/suggestions on what could be going wrong?