A thought:

On Fri, Oct 27, 2017 at 6:27 AM, Stephen Kennedy <[email protected]> wrote:

> Sorry to resurrect an old topic, but I am having the exact same conundrum.
>
> My particular use case is:
> - I have a persistent actor that is similar to a FSM  with a "state" enum
> that represents its current state
> - Some additional business logic has lead to me wanting to inspect the
> previous states the actor has gone through to get to the current state - so
> I now want to keep a list of historical states in that actor
> - This seems perfect for the Event sourcing model, I have all the
> historical events so I can recreate the historical states in recovery
> - But - snapshots get in the way of this! - to recover the historical
> states from a snapshot I need to persist them to my snapshot, but old
> snapshots won't have this which will then break my business logic
>

I do this heavily -- the *history* of my Actor is available at the user
level, so that they can examine previous states, undo previous actions, and
stuff like that.

But it doesn't belong in the same Actor.  I handle this in a sibling Actor,
which uses Persistence Query to read in and process the history, and
exposes it that way.  That has nothing to do with snapshots (indeed,
they're not even available); it's a simple read of the history.

Persistence Query is a useful tool, and the right way to do "history"-ish
features...

-- 
>>>>>>>>>>      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 https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to