[akka-user] akka-persistence: persistAsync interaction with snapshots

2015-03-03 Thread Tal Pressman
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

Re: [akka-user] akka-persistence: persistAsync interaction with snapshots

2015-03-04 Thread Björn Antonsson
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 ev

Re: [akka-user] akka-persistence: persistAsync interaction with snapshots

2015-03-08 Thread Tal Pressman
Hi Björn, Thanks for your reply. Let me see if I understand correctly. If I have an actor with a counter, then this code would be problematic: class MyActor extends PersistentActor { var counter = 0 override def receiveCommand: Receive = { case Increment => counter += 1 // <<< sh

Re: [akka-user] akka-persistence: persistAsync interaction with snapshots

2015-03-09 Thread Patrik Nordwall
On Sun, Mar 8, 2015 at 9:22 AM, Tal Pressman wrote: > Hi Björn, > > Thanks for your reply. > > Let me see if I understand correctly. If I have an actor with a counter, > then this code would be problematic: > > class MyActor extends PersistentActor { > var counter = 0 > override def receiveCo

Re: [akka-user] akka-persistence: persistAsync interaction with snapshots

2015-03-10 Thread Tal Pressman
Hi, Thanks for your response. Let me (try to) clarify my questions. I guess I oversimplified my example so it, so I'll try again. I have an actor (persistent with at-least-once-delivery), and I want it to process messages "immediately" upon arrival. That is, I don't want to wait for the persis

Re: [akka-user] akka-persistence: persistAsync interaction with snapshots

2015-03-10 Thread Patrik Nordwall
On Tue, Mar 10, 2015 at 11:36 AM, Tal Pressman wrote: > Hi, > > Thanks for your response. Let me (try to) clarify my questions. > > I guess I oversimplified my example so it, so I'll try again. I have an > actor (persistent with at-least-once-delivery), and I want it to process > messages "immedi