Tutorial
Sebastian, Thorsten
Retreat July 2017
Akka brings actor programming to the JVM.
What’s actor programming, though?
Object-oriented programming
→ Due to separations of concerns applications become easier to build and maintain.
“Task-oriented” programming
→ The decoupling of tasks from resources allows for asynchronous and parallel programming, thereby enhancing application efficiency and scalability.
Actor programming
→ Actor programming combines the advantages of object- and task-oriented programming.
What’s Akka?
Actor: encapsulates state and behavior
Hierarchy: decompose tasks and delegate to child actors
Message: share tasks, results etc. among actors
What’s Akka?
Actor system: container/runtime for actors
Remoting: applications can span actor systems
Numerous extensions:
A glance under the hood
Dispatcher
Threads
Remoting
Serializers
Event stream
Dispatcher
Remoting
Event stream
/
user
system
Controller
Worker
RemoteSystem
Worker
Unthreaded user-code
Managed mailbox
React to errors, new nodes, ...
Transparent multithreading and asynchronicity
Transparent communication with remote actor systems
System and remote actors reside here
Each actor has a path/URL
User actors reside here
Parents supervise children
Prime calculator: Basic structure
Master
PrimeWorker
PrimeWorker
PrimeWorker
Worker
Listener
Range
Primes
Primes
Range
Query
Reaper
Prime calculator: Distributed structure
Master
Worker
Listener
Range
Primes
Primes
Range
Query
Reaper
Reaper
Shepherd
Slave
Subscription
Subscription
Acknowledgement
Remote system
Let’s play! (Part I)
Prime calculator: Two-phase scaling
Worker
Master
Worker
Listener
Range
Primes
Primes
Range
Query
Reaper
Reaper
Shepherd
Slave
Subscription
Subscription
Acknowledgement
Remote system
Worker
Subworker
Subrange
Primes
Hands on: Create a local scheduler
Let’s play! (Part II)
Let’s play! (Part III)
Stumbling blocks
Further topics