Actors Model

Víctor Martínez

What it is?

A computational model in which the fundamental unit of computation is called an Actor

So, what can actors do?

Process

X

Y

Factorial

Store state

Actor

X=3

Communicate!

A

B

Give me some data!

Okay dude, here it is

Everything
is
an Actor

Actor System

Fundamental properties

  • Each actor run on its own single thread
  • Actors do not share state
  • Actors just receive messages and react to it

Addr 1

Addr 2

Addr 3

How can an Actor react to a message?

  • Send a message
  • Create more actors
  • Designate what to do with the next message

Articles API System

Web Server

Db Actor

Postgres DB

GET /3

get_article(3)

lookup article 3

Article data

Article obj

Article Response

Actors Model

By Víctor Martínez

Actors Model

  • 299