A concrete example:

Imagining you are doing some accounting and your events are a Json 
representing any particular operation:

   1. {"op":"set", "value":0}
   2. {"op":"add", "value":20}
   3. {"op":"substract", "value":20}

Then when you reply the events your account total should be zero.

That's the simplest example I could come up with, basically you store each 
Json event and your actor "knows" what to do with such information when it 
is activated.

HTH,

Guido.

On Sunday, March 12, 2017 at 6:03:31 PM UTC, Justin du coeur wrote:
>
> Generally not -- you define the "event" as a serializable data structure 
> that *describes* the transformation to execute, and that gets stored in the 
> event stream.  When you reload the Actor, you "replay" those events, and 
> your recovery logic interprets the events to actually change the data.  You 
> generally have a function that takes the stream of events and the starting 
> state, and does this interpretation.
>
> In principle, I suppose you *could* save the functions themselves as 
> bytecode, but I don't think I've ever heard of anyone doing so, and it 
> seems quite dangerous -- it could fail to load because dependencies had 
> changed, and other such problems.  (And it would likely be very bulky and 
> redundant.)
>
> On Sun, Mar 12, 2017 at 9:59 AM, kant kodali <[email protected] 
> <javascript:>> wrote:
>
>> Hi,
>>
>> What does it mean when someone says we store the event itself rather than 
>> storing the state/data? such that the events can be replayed to store the 
>> state/data. Does it mean storing the functions/transformation itself 
>> (simply put the JVM byte code for the function itself) ?
>>
>> Thanks!
>> kant
>>
>> -- 
>> >>>>>>>>>> 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] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
>>>>>>>>>>      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