Hi Tal, If you only update the state to be snapshotted in the handlers that you give to persistAsync, and send an immutable copy of the state to the snapshot method, then you should be fine. The async nature of persistAsync is that you continue processing messages while the persisting of the event happens, but you are still guaranteed that only one handler at a time will be executed in the actor, and that no other message processing is happening in the actor while the handler is being run.
Immutability of the state to snapshot is the key here, since the "timestamp" and the state will be picked up at consistent point, and sent of to the snapshot store, and then normal processing of messages will continue inside the actor. If the state is mutated while in flight to the snapshot store, then all bets are off. B/ On 3 March 2015 at 16:38:39, Tal Pressman ([email protected]) wrote: Hi, Sorry in advance if this has already been answered somewhere, I couldn't find it... I have a PersistentActor, and I use persistAsync to persist its events. Now I want to add snapshots into the mix. So from what I understand from the documentation, having a snapshot with a timestamp T means I wouldn't get any events that were persisted prior to T. But when are these timestamps generated? Is it possible that I will miss events? Is it possible that an event that was already taken into account in the snapshot be processed again? Thanks, Tal -- >>>>>>>>>> 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. -- Björn Antonsson Typesafe Inc. – Reactive Apps on the JVM twitter: bantonsson JOIN US. REGISTER TODAY! Scala Days March 16th-18th, San Francisco -- >>>>>>>>>> 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.
