The author is managing editor of http://scalacourses.com, which offers self-paced online courses that teach Introductory and Intermediate Scala and Play Framework.
2. akka.actor.Actor
• Will replace scala.actors.Actor 'real soon
now'
• Are managed by akka.actor.ActorRefs
• ActorRefs are opaque (cannot inspect Actor
properties or call methods)
• Must communicate with Actors via messages sent
to their ActorRef
3. Messages
• Arrive at actor mailboxes in the order they were
sent.
• Actors can reply to messages, except
• Only Actors can receive messages
• If an actor is sent a message by a non-actor, no reply is possible
4. Actors and Dispatchers
• Actors are scheduled by dispatchers
• The default dispatcher works fine for many uses
• Various dispatcher algorithms are available
• Do not code to a specific dispatcher algorithm;
the algorithm is usually defined in akka.conf
5. akka.stm.Ref
• STM: Software Transactional Memory
• Each Ref get/set is always atomic (wrapped in a
transaction)
• Transactions are (relatively) expensive
6. How to Obtain Partial Simulation Results?
1.Create an inner class that accesses a property
outside its scope, or
2.Use an STM Ref
• Inner class approach breaks OO encapsulation