8. • The actor model in computer science is
a mathematical model of concurrent
computation that treats "actors" as the
universal primitives of concurrent
computation.
• In response to a message that it receives, an
actor can: make local decisions, create more
actors, send more messages, and determine
how to respond to the next message
received.
9. • Encapsulated state
• Behaviour
• Indepedent control
• Mailbox
http://brianrepko.github.io/presentation-big-data-bioinfo/images/actor-model.png
10. Address
• Identifies an actor
• May also represent a proxy/forwarder to an an Actor
• Contains location and transport information
• Location transparency
11. Address
• One actor may represent many actors (pool)
• One actor may have many address
Load
Balancer
Actor
Actor
Actor
Actor
Machine 1
Machine 2
Actor Actor Actor
X
Y
Z
12. • Each actor has its own process (not intended
as an OS process) and they don’t share state
between them.
• Actors can change their own states.
• Actors can create other actors and when they
do that they receive back the new actor
address.
• Actor exchange messages in an asynchronous
fashion.
13. Handling Errors
• Supervision : The running state of an actor is
monitored and managed by another actor (Supervisor)
https://petabridge.com/blog/how-actors-recover-from-failure-hierarchy-and-supervision/
14. • Address does not change during restarts
• Mailboxes are persisted outside the actor
instances
http://getakka.net/docs/concepts/actors
16. • No shared memory and therefore locking is
not required.
• Race conditions greatly reduced.
• It greatly simplifies the control flow of a
program, each actor has its own process
(flow of control)
• Easy to distribute, across cores, across
program boundaries, across machines.
• It simplifies error handling code.
• It makes it easier to build fault-tolerant
systems.
17. • Too many actors ( Tracing )
• Testing
• Debugging
• Don’t work well when
• shared state needed
• need to achieve global consensus
• synchronous behaviour is needed