Your SlideShare is downloading. ×
Introduction to Akka 1.2          Mike Slinn       SF Scala Meetup        Nov 21, 2011
akka.actor.Actor• Will replace scala.actors.Actor real soon  now• Are managed by akka.actor.ActorRefs• ActorRefs are opaqu...
Messages• Arrive at actor mailboxes in the order they were  sent.• Actors can reply to messages, except• Only Actors can r...
Actors and Dispatchers•   Actors are scheduled by dispatchers•   The default dispatcher works fine for many uses•   Variou...
akka.stm.Ref• STM: Software Transactional Memory• Each Ref get/set is always atomic (wrapped in a  transaction)• Transacti...
How to Obtain Partial Simulation Results?1.Create an inner class that accesses a property  outside its scope, or2.Use an S...
Now we are ready to look at Hanuman
Upcoming SlideShare
Loading in...5
×

Introduction to akka

1,089

Published on

The author is managing editor of http://scalacourses.com, which offers self-paced online courses that teach Introductory and Intermediate Scala and Play Framework.

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,089
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "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, or2.Use an STM Ref• Inner class approach breaks OO encapsulation
  7. 7. Now we are ready to look at Hanuman

×