SlideShare uma empresa Scribd logo
1 de 23
Baixar para ler offline
The Actor Model
1
An alternative approach to concurrency
Lorenzo Nicora
Senior Consultant @ OpenCredo
@nicusX
https://opencredo.com/author/lorenzo/
✓ (1973) Carl Hewitt: “A Universal Modular Actor Formalism for Artificial Intelligence”
2
A bit of History…
1973
2009
✓ (2009) Akka toolkit, Scala/Java
✓ (1986) Ericsson: Erlang
Lorenzo Nicora Actor Model
According to Alan Kay,
author of Smalltalk 

and inventor of the “Object-Orientation”:
3
The original idea of Object
An “Object”
✓ Is the basic unit of object-oriented system
✓ Has its own state
✓ Communicate with others 

by sending and receiving messages*
* in Java, C++, C# (derived from Simula, not Smalltalk)
Objects interact by invoking methods
1980
Lorenzo Nicora Actor Model
An “Actor” 

is a computational entity that, 

in response to a message it receives, 

can concurrently:
a) Send a finite number of messages to other actors
b) Create a finite number of new actors
c) Designate the behaviour to be used for the next message
it receives. [implies a state]
4
The Actor
Actor
Actor
Actor
Mailbox Mailbox
Mailbox
Lorenzo Nicora Actor Model
Actors interacts 

only by messaging
Actors react to 

messages
5
Actors are Reactive
Lorenzo Nicora Actor Model
An Actor handles one message a time
Never concurrently
An Actor has a state
State cannot be modified from outside the actor
6
Thread-safe
An Actor is inherently thread-safe
No Lock/Synchronisation on State
Lorenzo Nicora Actor Model
7
Supervision
Actors are created by Actors 

Parent -> Child
Lorenzo Nicora Actor Model
8
Supervision
Failure Handling
• If a Child throws an Exception, the Supervisor get notified
• Supervision Strategy: e.g. relaunch, abandon…
Failure is always handled consistently
Parent = Supervisor
Lorenzo Nicora Actor Model
9
Lightweight
Actor is lightweight
Creating an Actor has little overhead
beyond creating an Object
Lorenzo Nicora Actor Model
Non-blocking implementation
of Request/Response pattern 

with multiple downstream collaborators
10
Example: Non-blocking Request/Response
• One-Actor-per-Request pattern
• Enterprise Integration Patterns:
✴ Request/Reply
✴ Return Address
✴ Scatter-Gather, Aggregators
✴ Round-robin Message Router
Lorenzo Nicora Actor Model
11
Example: Non-blocking Request/Response
Lorenzo Nicora Actor Model
12
Example: Non-blocking Request/Response
Lorenzo Nicora Actor Model
13
Example: Non-blocking Request/Response
Lorenzo Nicora Actor Model
14
Example: Non-blocking Request/Response
Lorenzo Nicora Actor Model
15
Example: Non-blocking Request/Response
Lorenzo Nicora Actor Model
16
Example: Non-blocking Request/Response
Lorenzo Nicora Actor Model
17
Example: Non-blocking Request/Response
Lorenzo Nicora Actor Model
18
Example: Non-blocking Request/Response
Lorenzo Nicora Actor Model
19
Example: Non-blocking Request/Response
Lorenzo Nicora Actor Model
20
Example: Non-blocking Request/Response
Lorenzo Nicora Actor Model
21
Example: Non-blocking Request/Response
Lorenzo Nicora Actor Model
22
Conclusions
Actor model: 

an alternative approach to concurrency

Actors, Threads
+ Business logic implementation + 

inherently thread-safe
- A new programming paradigm - 

to learn
Lorenzo Nicora Actor Model
23
Lorenzo Nicora Actor Model

Mais conteúdo relacionado

Destaque

New microsoft office power point presentation copy
New microsoft office power point presentation   copyNew microsoft office power point presentation   copy
New microsoft office power point presentation copy
kor
 

Destaque (20)

Evolving Project Management: from the sin to the virtue by Antonio Cobo
Evolving Project Management: from the sin to the virtue by Antonio CoboEvolving Project Management: from the sin to the virtue by Antonio Cobo
Evolving Project Management: from the sin to the virtue by Antonio Cobo
 
ServerlessConf: Serverless for the Enterprise - Rafal Gancarz
ServerlessConf: Serverless for the Enterprise - Rafal GancarzServerlessConf: Serverless for the Enterprise - Rafal Gancarz
ServerlessConf: Serverless for the Enterprise - Rafal Gancarz
 
High Load Strategy 2016 - Project Management: from Stone Age to DevOps
High Load Strategy 2016 - Project Management: from Stone Age to DevOps High Load Strategy 2016 - Project Management: from Stone Age to DevOps
High Load Strategy 2016 - Project Management: from Stone Age to DevOps
 
A Visual Introduction to Event Sourcing and CQRS by Lorenzo Nicora
A Visual Introduction to Event Sourcing and CQRS by Lorenzo NicoraA Visual Introduction to Event Sourcing and CQRS by Lorenzo Nicora
A Visual Introduction to Event Sourcing and CQRS by Lorenzo Nicora
 
muCon 2016: Authentication in Microservice Systems By David Borsos
muCon 2016: Authentication in Microservice Systems By David BorsosmuCon 2016: Authentication in Microservice Systems By David Borsos
muCon 2016: Authentication in Microservice Systems By David Borsos
 
Microservices Manchester: Microservices and Macro-Economics - A Shorty Histor...
Microservices Manchester: Microservices and Macro-Economics - A Shorty Histor...Microservices Manchester: Microservices and Macro-Economics - A Shorty Histor...
Microservices Manchester: Microservices and Macro-Economics - A Shorty Histor...
 
Vault: Beyond secret storage - Using Vault to harden your infrastructure
Vault: Beyond secret storage - Using Vault to harden your infrastructureVault: Beyond secret storage - Using Vault to harden your infrastructure
Vault: Beyond secret storage - Using Vault to harden your infrastructure
 
Microservices Manchester: Security, Microservces and Vault by Nicki Watt
Microservices Manchester:  Security, Microservces and Vault by Nicki WattMicroservices Manchester:  Security, Microservces and Vault by Nicki Watt
Microservices Manchester: Security, Microservces and Vault by Nicki Watt
 
Microservices Manchester: Authentication in Microservice Systems by David Borsos
Microservices Manchester: Authentication in Microservice Systems by David BorsosMicroservices Manchester: Authentication in Microservice Systems by David Borsos
Microservices Manchester: Authentication in Microservice Systems by David Borsos
 
Spring Boot Microservices vs Akka Actor Cluster
Spring Boot Microservices vs Akka Actor Cluster Spring Boot Microservices vs Akka Actor Cluster
Spring Boot Microservices vs Akka Actor Cluster
 
New microsoft office power point presentation copy
New microsoft office power point presentation   copyNew microsoft office power point presentation   copy
New microsoft office power point presentation copy
 
Thesis Presentation Ppt Slides 11 18 2011
Thesis Presentation Ppt Slides 11 18 2011Thesis Presentation Ppt Slides 11 18 2011
Thesis Presentation Ppt Slides 11 18 2011
 
ThingMonk 2016 - Concursus Event sourcing for the IOT By Tareq Abedrabbo & Do...
ThingMonk 2016 - Concursus Event sourcing for the IOT By Tareq Abedrabbo & Do...ThingMonk 2016 - Concursus Event sourcing for the IOT By Tareq Abedrabbo & Do...
ThingMonk 2016 - Concursus Event sourcing for the IOT By Tareq Abedrabbo & Do...
 
Chronix as Long-Term Storage for Prometheus
Chronix as Long-Term Storage for PrometheusChronix as Long-Term Storage for Prometheus
Chronix as Long-Term Storage for Prometheus
 
Internet And Self-organizing1
Internet And Self-organizing1Internet And Self-organizing1
Internet And Self-organizing1
 
Gebeurtenis
GebeurtenisGebeurtenis
Gebeurtenis
 
Why?What?How?
Why?What?How?Why?What?How?
Why?What?How?
 
Lesson level ! of English
Lesson level ! of EnglishLesson level ! of English
Lesson level ! of English
 
Addgene
AddgeneAddgene
Addgene
 
Motywacja użytkowników e-szkoleń
Motywacja użytkowników e-szkoleńMotywacja użytkowników e-szkoleń
Motywacja użytkowników e-szkoleń
 

Semelhante a Haufe #msaday - The Actor model: an alternative approach to concurrency By Lorenzo Nicora

Semelhante a Haufe #msaday - The Actor model: an alternative approach to concurrency By Lorenzo Nicora (20)

DDD loves Actor Model and Actor Model loves Elixir
DDD loves Actor Model and Actor Model loves ElixirDDD loves Actor Model and Actor Model loves Elixir
DDD loves Actor Model and Actor Model loves Elixir
 
Actor Model & Reactive Manifesto
Actor Model & Reactive ManifestoActor Model & Reactive Manifesto
Actor Model & Reactive Manifesto
 
The Problematic Situation Aspect of Conceptual Design
The Problematic Situation Aspect of Conceptual DesignThe Problematic Situation Aspect of Conceptual Design
The Problematic Situation Aspect of Conceptual Design
 
Why the use case
Why the use caseWhy the use case
Why the use case
 
CarolinaCon Presentation on Streaming Analytics
CarolinaCon Presentation on Streaming AnalyticsCarolinaCon Presentation on Streaming Analytics
CarolinaCon Presentation on Streaming Analytics
 
How To Write A Case Study Essay. Online assignment writing service.
How To Write A Case Study Essay. Online assignment writing service.How To Write A Case Study Essay. Online assignment writing service.
How To Write A Case Study Essay. Online assignment writing service.
 
Actors, Fault tolerance and OTP
Actors, Fault tolerance and OTPActors, Fault tolerance and OTP
Actors, Fault tolerance and OTP
 
Dive into Akka Actors
Dive into Akka ActorsDive into Akka Actors
Dive into Akka Actors
 
Revising Your Argument - Excelsior College OWL
Revising Your Argument - Excelsior College OWLRevising Your Argument - Excelsior College OWL
Revising Your Argument - Excelsior College OWL
 
Holland & Barrett: Gen AI Prompt Engineering for Tech teams
Holland & Barrett: Gen AI Prompt Engineering for Tech teamsHolland & Barrett: Gen AI Prompt Engineering for Tech teams
Holland & Barrett: Gen AI Prompt Engineering for Tech teams
 
Un actor (model) per amico - Alessandro Melchiori - Codemotion Milan 2016
Un actor (model) per amico - Alessandro Melchiori - Codemotion Milan 2016Un actor (model) per amico - Alessandro Melchiori - Codemotion Milan 2016
Un actor (model) per amico - Alessandro Melchiori - Codemotion Milan 2016
 
Design_Patterns_Dr.CM.ppt
Design_Patterns_Dr.CM.pptDesign_Patterns_Dr.CM.ppt
Design_Patterns_Dr.CM.ppt
 
רועי פלד
רועי פלדרועי פלד
רועי פלד
 
Introduction to Design Patterns and Singleton
Introduction to Design Patterns and SingletonIntroduction to Design Patterns and Singleton
Introduction to Design Patterns and Singleton
 
Beyond fault tolerance with actor programming - Fabio Tiriticco - Codemotion ...
Beyond fault tolerance with actor programming - Fabio Tiriticco - Codemotion ...Beyond fault tolerance with actor programming - Fabio Tiriticco - Codemotion ...
Beyond fault tolerance with actor programming - Fabio Tiriticco - Codemotion ...
 
Beyond Fault Tolerance with Actor Programming
Beyond Fault Tolerance with Actor ProgrammingBeyond Fault Tolerance with Actor Programming
Beyond Fault Tolerance with Actor Programming
 
Effect systems in scala: beyond flatmap
Effect systems in scala: beyond flatmapEffect systems in scala: beyond flatmap
Effect systems in scala: beyond flatmap
 
OOP History and Core Concepts
OOP History and Core ConceptsOOP History and Core Concepts
OOP History and Core Concepts
 
From Zero to the Actor Model (With Akka.Net) - CodeMash2017 - Tamir Dresher
From Zero to the Actor Model (With Akka.Net) - CodeMash2017 - Tamir DresherFrom Zero to the Actor Model (With Akka.Net) - CodeMash2017 - Tamir Dresher
From Zero to the Actor Model (With Akka.Net) - CodeMash2017 - Tamir Dresher
 
akka-scalaphx-jun2015
akka-scalaphx-jun2015akka-scalaphx-jun2015
akka-scalaphx-jun2015
 

Mais de OpenCredo

Kafka Summit 2018: A Journey Building Kafka Connectors - Pegerto Fernandez
Kafka Summit 2018: A Journey Building Kafka Connectors - Pegerto FernandezKafka Summit 2018: A Journey Building Kafka Connectors - Pegerto Fernandez
Kafka Summit 2018: A Journey Building Kafka Connectors - Pegerto Fernandez
OpenCredo
 
MuCon 2017: A not So(A) Trivial Question by Tareq Abedrabbo
MuCon 2017: A not So(A) Trivial Question by Tareq AbedrabboMuCon 2017: A not So(A) Trivial Question by Tareq Abedrabbo
MuCon 2017: A not So(A) Trivial Question by Tareq Abedrabbo
OpenCredo
 

Mais de OpenCredo (12)

Webinar - Design Thinking for Platform Engineering
Webinar - Design Thinking for Platform EngineeringWebinar - Design Thinking for Platform Engineering
Webinar - Design Thinking for Platform Engineering
 
MuCon 2019: Exploring Your Microservices Architecture Through Network Science...
MuCon 2019: Exploring Your Microservices Architecture Through Network Science...MuCon 2019: Exploring Your Microservices Architecture Through Network Science...
MuCon 2019: Exploring Your Microservices Architecture Through Network Science...
 
Goto Chicago; Journeys To Cloud Native Architecture: Sun, Sea And Emergencies...
Goto Chicago; Journeys To Cloud Native Architecture: Sun, Sea And Emergencies...Goto Chicago; Journeys To Cloud Native Architecture: Sun, Sea And Emergencies...
Goto Chicago; Journeys To Cloud Native Architecture: Sun, Sea And Emergencies...
 
Mucon 2018: Heuristics for Identifying Microservice Boundaries By Erich Eichi...
Mucon 2018: Heuristics for Identifying Microservice Boundaries By Erich Eichi...Mucon 2018: Heuristics for Identifying Microservice Boundaries By Erich Eichi...
Mucon 2018: Heuristics for Identifying Microservice Boundaries By Erich Eichi...
 
Journeys To Cloud Native Architecture: Sun, Sea And Emergencies - Nicki Watt
Journeys To Cloud Native Architecture: Sun, Sea And Emergencies - Nicki WattJourneys To Cloud Native Architecture: Sun, Sea And Emergencies - Nicki Watt
Journeys To Cloud Native Architecture: Sun, Sea And Emergencies - Nicki Watt
 
Machine Learning Game Changer for IT - Maartens Lourens
Machine Learning Game Changer for IT - Maartens LourensMachine Learning Game Changer for IT - Maartens Lourens
Machine Learning Game Changer for IT - Maartens Lourens
 
Kafka Summit 2018: A Journey Building Kafka Connectors - Pegerto Fernandez
Kafka Summit 2018: A Journey Building Kafka Connectors - Pegerto FernandezKafka Summit 2018: A Journey Building Kafka Connectors - Pegerto Fernandez
Kafka Summit 2018: A Journey Building Kafka Connectors - Pegerto Fernandez
 
MuCon 2017: A not So(A) Trivial Question by Tareq Abedrabbo
MuCon 2017: A not So(A) Trivial Question by Tareq AbedrabboMuCon 2017: A not So(A) Trivial Question by Tareq Abedrabbo
MuCon 2017: A not So(A) Trivial Question by Tareq Abedrabbo
 
DevOpsCon Berlin 2017: Project Management from Stone Age to DevOps By Antoni...
DevOpsCon Berlin 2017: Project Management from Stone Age to DevOps  By Antoni...DevOpsCon Berlin 2017: Project Management from Stone Age to DevOps  By Antoni...
DevOpsCon Berlin 2017: Project Management from Stone Age to DevOps By Antoni...
 
Hashidays London 2017 - Evolving your Infrastructure with Terraform By Nicki ...
Hashidays London 2017 - Evolving your Infrastructure with Terraform By Nicki ...Hashidays London 2017 - Evolving your Infrastructure with Terraform By Nicki ...
Hashidays London 2017 - Evolving your Infrastructure with Terraform By Nicki ...
 
Succeeding with DevOps Transformation - Rafal Gancarz
Succeeding with DevOps Transformation - Rafal GancarzSucceeding with DevOps Transformation - Rafal Gancarz
Succeeding with DevOps Transformation - Rafal Gancarz
 
Progscon 2017: Serverless Architectures - Rafal Gancarz
Progscon 2017: Serverless Architectures - Rafal GancarzProgscon 2017: Serverless Architectures - Rafal Gancarz
Progscon 2017: Serverless Architectures - Rafal Gancarz
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

Haufe #msaday - The Actor model: an alternative approach to concurrency By Lorenzo Nicora