Hi R Welling, onRecoveryCompleted is meant to be a hook for handling side effects - operations not affecting the domain state, that need to be executed following the recovery, like sending a message to another actor, or logging, or maybe initializing something inside the actor. This function was not designed to emit domain events. Restart or recovery of an actor seems more like a side effect than something relevant to actor's domain.
You can implement additional actor ActivityWatcher that will receive events relevant to MyPersistentFSM's activity. This ActivityWatcher can persist events relevant to MyPersistentFSM's activity and MyPersistentFSM can concentrate on emitting business events (I assume it's supposed to do something additionally to tracking it's uptime). Then in onRecoveryCompleted of MyPersistentFSM you can simply sent an ActorRestarted message to ActivityWatcher and it can persist the change. Regarding using persist or saving a snapshot - this can interfere with PersistentFSM's logic and can cause different state data to be constructed when the actor is alive and following the recovery. This can possibly be fixed by implementing persist and persistAll functions in PersistentFSM so that they trigger applyEvent function to construct the next state data. saveSnapsot should probably also be implemented in PersistentFSM. Then you'd be able to simply use persist. Although, as I mentioned earlier, I'm not sure it' should be implemented this way. Regards, Leonid -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
