Successfully reported this slideshow.
Your SlideShare is downloading. ×

Introduction to akka

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Loading in …3
×

Check these out next

1 of 7 Ad

More Related Content

Advertisement

Recently uploaded (20)

Introduction to akka

  1. 1. Introduction to Akka 1.2 Mike Slinn SF Scala Meetup Nov 21, 2011
  2. 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. 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. 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. 5. akka.stm.Ref • STM: Software Transactional Memory • Each Ref get/set is always atomic (wrapped in a transaction) • Transactions are (relatively) expensive
  6. 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
  7. 7. Now we are ready to look at Hanuman

×