[akka-user] Re: Akka FSM, persistence and timeouts

2016-09-26 Thread Eugene Dzhurinsky
Zhenya, thanks for the reply! Actually at this point I see that there're no benefits on using of Akka Persistence, I could easily use some K/V storage to store the key as the workflow ID and value - the state of the actors, so upon recovery I could read from that storage and recreate the FSM

[akka-user] Re: Akka FSM, persistence and timeouts

2016-09-26 Thread Evgeny Shepelyuk
Hello We're trying to implement something similar (i.e. when Actor recovered, we want side-effects to not happen again). During recovery, events are not applied immediately to internal state, but we're waiting until recovery is completed and then decide what to do next, based on latest replied

[akka-user] Re: Akka FSM, persistence and timeouts

2016-09-26 Thread Eugene Dzhurinsky
Tal, thanks for the response! As far as I know, when an actor is recovered through Akka Persistence - the whole set of events is being re-send to the actor, so it can recover the state. In my case, some states will have side-effects, like "send an e-mail" or "update the database". Obviously I

[akka-user] Re: Akka FSM, persistence and timeouts

2016-09-26 Thread Tal Pressman
Hi, One possible solution using PersistentFSM would be to save the persist with the timestamp when it happened, and then when applying the event you could set a timer (using setTimer or system.scheduler) that would trigger the state change. This way, when the events are processed during