Hi folks,

Good day. I'm just starting with Akka (Java with Lambda) and I have a 
question regarding AbstractFSM. 

When using "*akka.actor.FSM.State.using(Data)*" does "*Data*" need to be 
immutable?

Example:
*when(State.Idle,*
* matchEvent(Event.class, StateData.class,*
* (event, stateData) ->*
* stay().using(new StateData())));*

* when(State.Active,*
* matchEvent(Event.class, StateData.class,*
* (event, stateData) -> goTo(State.Idle).using(stateData.mutate())));*


                .......
              * public class StateData{*
* public StateData mutate(){*
* //mutate myself*
* return this;*
* }*
             
 Is it safe to mutate the data this way? I'm uncertain since I saw that 
"*akka.actor.AbstractFSM.onTransition(PartialFunction<Tuple2<BatchingState, 
BatchingState>, BoxedUnit>)*" allows you to access both the current 
stateData and the nextStateData. 

 
Any help would be much appreciated. Thanks and have a great day.

-- 
>>>>>>>>>>      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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
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