actor model

88 阅读1分钟

www.brianstorti.com/the-actor-m….

Actors

An actor is the primitive unit of computation. It’s the thing that receives a message and does some kind of computation based on it.

The idea is very similar to what we have in object-oriented languages: An object receives a message (a method call) and does something depending on which message it receives (which method we are calling).

The main difference is that actors are completely isolated from each other and they will never share memory. It’s also worth noting that an actor can maintain a private state that can never be changed directly by another actor.

Actors have mailboxes

image.png

doc.akka.io/docs/akka/c…

How the Actor Model Meets the Needs of Modern, Distributed Systems

Usage of message passing avoids locking and blocking