I had in mind that I would strive to have a single var in my actors, which was a reference to an immutable object.
One issue I've run into that since the actors go through various states of initialization (using become), I find myself with bits of state which can't be initialized in the constructor unless they're Options that can be None. But then there's a bit of extra nuisance processing messages down the line, when I *know* the option is a Some. I could put some of this optional-because-available-later state in the parameter list of receive() functions. Or I could just assert x.isdefined and assign x.get to a local val. Or I could make my immutable model implement a trait with multiple implementations (private case classes in the companion object say) where the "later" state could have the valid references without any Option wrapping. This assumes the logic in the receive block is delegated to the model object. Or ? So I'm just curious what patterns might have worked well for others. Thanks. -- >>>>>>>>>> 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 http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
