SlideShare a Scribd company logo
1 of 14
Download to read offline
An Introduction to
Akka and the Actor-Based Model
Daniela Sfregola
@DanielaSfregola
http://danielasfregola.com/
Scala Italy 2015
An Introduction to Akka and the Actor-Based Model 1/14
Outline
Motivation: Concurrency
Thread-Lock-Monitor Approach
Message-Passing Approach
Akka as Message-Passing Framework
Actors in Akka
Actor Life Cycle
Actors Hierarchy
Supervision Rules
Demo
An Introduction to Akka and the Actor-Based Model 2/14
Motivation: Concurrency
Low Cost Hardware
Multiple Core CPUs
Distributed Systems
Big Data
Parallelism
We need to deal with shared resources between processes!
An Introduction to Akka and the Actor-Based Model 3/14
Thread-Lock-Monitor Approach
Thread-Lock-Monitor approach can be challenging:
Logic complicated for humans
Difficult to design and maintain
High unpredictability
Do we have an easier approach to tackle concurrency problems?
An Introduction to Akka and the Actor-Based Model 4/14
Message-Passing Approach
The Message-Passing Approach:
Encapsulates all the shared information in messages
Messages are used to communicate between processes
An Introduction to Akka and the Actor-Based Model 5/14
Akka as Message-Passing Framework
Akka - from akka.io
Build powerful concurrent & distributed applications more easily.
Simple Concurrency & Distribution
Resilient by Design
High Performance
Elastic & Decentralized
Extensible
It supports Scala, Java... .NET is coming soon!
An Introduction to Akka and the Actor-Based Model 6/14
Actors in Akka
Lightweight concurrent entity
Event-driven
Mailbox of messages processed asynchronously
Can hold status/mutability
An Introduction to Akka and the Actor-Based Model 7/14
Actor Life Cycle
Akka in action (2013) by R. Roestenburg, R. Bakker and R. Williams.
Shelter Island: Manning Publication
An Introduction to Akka and the Actor-Based Model 8/14
Actors Hierarchy
from http://doc.akka.io/docs/akka/snapshot/general/supervision.html#supervision,
accessed on May 2015
An Introduction to Akka and the Actor-Based Model 9/14
Supervision Rules
Your Father is your Supervisor
Every Actor has a Supervisor, but the Guardian Actor (/user)
Your Children follow your destiny
If unable to handle an exception, escalate it to your Supervisor
If the Guardian Actor is unable to handle an exception, the system
will shutdown
An Introduction to Akka and the Actor-Based Model 10/14
Actor Core Operations
There are four core operations on Actors:
create
send
become
supervise
An Introduction to Akka and the Actor-Based Model 11/14
Demo
Demo Time!
Gist available at
https://gist.github.com/DanielaSfregola/
6dc52bffa2ed566de9b2
An Introduction to Akka and the Actor-Based Model 12/14
Conclusions
Akka as Message-Passing approach to concurrency
Main components: Actors
Best Practices:
Never Block
Communicate only via messages
Messages should be immutable
Messages should be complete and self-contained
An Introduction to Akka and the Actor-Based Model 13/14
Conclusions
Akka as Message-Passing approach to concurrency
Main components: Actors
Best Practices:
Never Block
Communicate only via messages
Messages should be immutable
Messages should be complete and self-contained
Thank you!
An Introduction to Akka and the Actor-Based Model 14/14

More Related Content

What's hot

Actor Patterns and NATS - Boulder Meetup
Actor Patterns and NATS - Boulder MeetupActor Patterns and NATS - Boulder Meetup
Actor Patterns and NATS - Boulder MeetupApcera
 
You Used To Inject Me In Your Constructor
 You Used To Inject Me In Your Constructor You Used To Inject Me In Your Constructor
You Used To Inject Me In Your ConstructorVeronica Lillie
 
Fundamentals of Akka - Webinar
Fundamentals of Akka - WebinarFundamentals of Akka - Webinar
Fundamentals of Akka - WebinarKnoldus Inc.
 
SOLID Design Principles
SOLID Design PrinciplesSOLID Design Principles
SOLID Design PrinciplesSamuel Breed
 
Introduction to Functional Reactive Programming
Introduction to Functional Reactive ProgrammingIntroduction to Functional Reactive Programming
Introduction to Functional Reactive ProgrammingĐặng Thái Sơn
 
Discovering the Service Fabric's actor model
Discovering the Service Fabric's actor modelDiscovering the Service Fabric's actor model
Discovering the Service Fabric's actor modelMassimo Bonanni
 
Rethinking the debugger
Rethinking the debuggerRethinking the debugger
Rethinking the debuggerIulian Dragos
 
Let it crash! The Erlang Approach to Building Reliable Services
Let it crash! The Erlang Approach to Building Reliable ServicesLet it crash! The Erlang Approach to Building Reliable Services
Let it crash! The Erlang Approach to Building Reliable ServicesBrian Troutwine
 
Beyond Fault Tolerance with Actor Programming
Beyond Fault Tolerance with Actor ProgrammingBeyond Fault Tolerance with Actor Programming
Beyond Fault Tolerance with Actor ProgrammingFabio Tiriticco
 
Akka - young fighter course
Akka - young fighter courseAkka - young fighter course
Akka - young fighter courseDmitriy Gutman
 
How does Scala's Future work?
How does Scala's Future work?How does Scala's Future work?
How does Scala's Future work?Hanfei Sun
 
How netty works internally
How netty works internallyHow netty works internally
How netty works internallyAmirHossain94
 
Erlang workshopdrammen
Erlang workshopdrammenErlang workshopdrammen
Erlang workshopdrammenReidar Sollid
 

What's hot (19)

Actor Patterns and NATS - Boulder Meetup
Actor Patterns and NATS - Boulder MeetupActor Patterns and NATS - Boulder Meetup
Actor Patterns and NATS - Boulder Meetup
 
Introduction to the Actor Model
Introduction to the Actor ModelIntroduction to the Actor Model
Introduction to the Actor Model
 
Relax, it's spa time
Relax, it's spa timeRelax, it's spa time
Relax, it's spa time
 
Solid principles
Solid principlesSolid principles
Solid principles
 
You Used To Inject Me In Your Constructor
 You Used To Inject Me In Your Constructor You Used To Inject Me In Your Constructor
You Used To Inject Me In Your Constructor
 
Fundamentals of Akka - Webinar
Fundamentals of Akka - WebinarFundamentals of Akka - Webinar
Fundamentals of Akka - Webinar
 
SOLID Design Principles
SOLID Design PrinciplesSOLID Design Principles
SOLID Design Principles
 
Introduction to Functional Reactive Programming
Introduction to Functional Reactive ProgrammingIntroduction to Functional Reactive Programming
Introduction to Functional Reactive Programming
 
Discovering the Service Fabric's actor model
Discovering the Service Fabric's actor modelDiscovering the Service Fabric's actor model
Discovering the Service Fabric's actor model
 
Rethinking the debugger
Rethinking the debuggerRethinking the debugger
Rethinking the debugger
 
Fp and scala
Fp and scalaFp and scala
Fp and scala
 
Let it crash! The Erlang Approach to Building Reliable Services
Let it crash! The Erlang Approach to Building Reliable ServicesLet it crash! The Erlang Approach to Building Reliable Services
Let it crash! The Erlang Approach to Building Reliable Services
 
SOLID Principles
SOLID PrinciplesSOLID Principles
SOLID Principles
 
Beyond Fault Tolerance with Actor Programming
Beyond Fault Tolerance with Actor ProgrammingBeyond Fault Tolerance with Actor Programming
Beyond Fault Tolerance with Actor Programming
 
Akka - young fighter course
Akka - young fighter courseAkka - young fighter course
Akka - young fighter course
 
How does Scala's Future work?
How does Scala's Future work?How does Scala's Future work?
How does Scala's Future work?
 
How netty works internally
How netty works internallyHow netty works internally
How netty works internally
 
Erlang workshopdrammen
Erlang workshopdrammenErlang workshopdrammen
Erlang workshopdrammen
 
Actor Model & Reactive Manifesto
Actor Model & Reactive ManifestoActor Model & Reactive Manifesto
Actor Model & Reactive Manifesto
 

Similar to Scala Italy 2015 - An Introduction to Akka and the Actor Based Model

Daniela Sfregola - Intro to Akka
Daniela Sfregola - Intro to AkkaDaniela Sfregola - Intro to Akka
Daniela Sfregola - Intro to AkkaScala Italy
 
Actor Patterns and NATS - Boulder Meetup
Actor Patterns and NATS - Boulder MeetupActor Patterns and NATS - Boulder Meetup
Actor Patterns and NATS - Boulder MeetupNATS
 
IEEE Day 2013 Baku - Spring Framework overview and Spring MVC
IEEE Day 2013 Baku - Spring Framework overview and Spring MVCIEEE Day 2013 Baku - Spring Framework overview and Spring MVC
IEEE Day 2013 Baku - Spring Framework overview and Spring MVCIlkin Ashrafli
 
Introduction to Actor Model and Akka
Introduction to Actor Model and AkkaIntroduction to Actor Model and Akka
Introduction to Actor Model and AkkaYung-Lin Ho
 
Actor-based concurrency in a modern Java Enterprise
Actor-based concurrency in a modern Java EnterpriseActor-based concurrency in a modern Java Enterprise
Actor-based concurrency in a modern Java EnterpriseAlexander Lukyanchikov
 
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 OpenCredo
 
Reactive programming with akka
Reactive programming with akkaReactive programming with akka
Reactive programming with akkaWebdesign Factory
 
Using Scrum on 3SL Cradle - traceability model and project schema
Using Scrum on 3SL Cradle - traceability model and project schemaUsing Scrum on 3SL Cradle - traceability model and project schema
Using Scrum on 3SL Cradle - traceability model and project schemaYulia Madorskaya
 
Scala introduction
Scala introductionScala introduction
Scala introductionzvikapika
 
Trivadis TechEvent 2016 Introduction to Lagom - another microservice-based fr...
Trivadis TechEvent 2016 Introduction to Lagom - another microservice-based fr...Trivadis TechEvent 2016 Introduction to Lagom - another microservice-based fr...
Trivadis TechEvent 2016 Introduction to Lagom - another microservice-based fr...Trivadis
 
Akka-intro-training-public.pdf
Akka-intro-training-public.pdfAkka-intro-training-public.pdf
Akka-intro-training-public.pdfBernardDeffarges
 
Display earthquakes with Akka-http
Display earthquakes with Akka-httpDisplay earthquakes with Akka-http
Display earthquakes with Akka-httpPierangelo Cecchetto
 
Build Cloud Applications with Akka and Heroku
Build Cloud Applications with Akka and HerokuBuild Cloud Applications with Akka and Heroku
Build Cloud Applications with Akka and HerokuSalesforce Developers
 
Akka for big data developers
Akka for big data developersAkka for big data developers
Akka for big data developersTaras Fedorov
 
Reactive Streams - László van den Hoek
Reactive Streams - László van den HoekReactive Streams - László van den Hoek
Reactive Streams - László van den HoekRubiX BV
 
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 ...Codemotion
 
Spring Framework Tutorial for Beginners.pdf
Spring Framework Tutorial for Beginners.pdfSpring Framework Tutorial for Beginners.pdf
Spring Framework Tutorial for Beginners.pdfSudhanshiBakre1
 

Similar to Scala Italy 2015 - An Introduction to Akka and the Actor Based Model (20)

Daniela Sfregola - Intro to Akka
Daniela Sfregola - Intro to AkkaDaniela Sfregola - Intro to Akka
Daniela Sfregola - Intro to Akka
 
Actor Patterns and NATS - Boulder Meetup
Actor Patterns and NATS - Boulder MeetupActor Patterns and NATS - Boulder Meetup
Actor Patterns and NATS - Boulder Meetup
 
IEEE Day 2013 Baku - Spring Framework overview and Spring MVC
IEEE Day 2013 Baku - Spring Framework overview and Spring MVCIEEE Day 2013 Baku - Spring Framework overview and Spring MVC
IEEE Day 2013 Baku - Spring Framework overview and Spring MVC
 
Introduction to Actor Model and Akka
Introduction to Actor Model and AkkaIntroduction to Actor Model and Akka
Introduction to Actor Model and Akka
 
Evolve18 | Abhishek Dwevidi & Varun Mitra | Intro to Backend Development in AEM
Evolve18 | Abhishek Dwevidi & Varun Mitra | Intro to Backend Development in AEMEvolve18 | Abhishek Dwevidi & Varun Mitra | Intro to Backend Development in AEM
Evolve18 | Abhishek Dwevidi & Varun Mitra | Intro to Backend Development in AEM
 
Actor-based concurrency in a modern Java Enterprise
Actor-based concurrency in a modern Java EnterpriseActor-based concurrency in a modern Java Enterprise
Actor-based concurrency in a modern Java Enterprise
 
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
 
Reactive programming with akka
Reactive programming with akkaReactive programming with akka
Reactive programming with akka
 
Using Scrum on 3SL Cradle - traceability model and project schema
Using Scrum on 3SL Cradle - traceability model and project schemaUsing Scrum on 3SL Cradle - traceability model and project schema
Using Scrum on 3SL Cradle - traceability model and project schema
 
When Camel Smiles
When Camel SmilesWhen Camel Smiles
When Camel Smiles
 
Scala introduction
Scala introductionScala introduction
Scala introduction
 
Trivadis TechEvent 2016 Introduction to Lagom - another microservice-based fr...
Trivadis TechEvent 2016 Introduction to Lagom - another microservice-based fr...Trivadis TechEvent 2016 Introduction to Lagom - another microservice-based fr...
Trivadis TechEvent 2016 Introduction to Lagom - another microservice-based fr...
 
Akka-intro-training-public.pdf
Akka-intro-training-public.pdfAkka-intro-training-public.pdf
Akka-intro-training-public.pdf
 
Display earthquakes with Akka-http
Display earthquakes with Akka-httpDisplay earthquakes with Akka-http
Display earthquakes with Akka-http
 
Build Cloud Applications with Akka and Heroku
Build Cloud Applications with Akka and HerokuBuild Cloud Applications with Akka and Heroku
Build Cloud Applications with Akka and Heroku
 
Akka for big data developers
Akka for big data developersAkka for big data developers
Akka for big data developers
 
Reactive Streams - László van den Hoek
Reactive Streams - László van den HoekReactive Streams - László van den Hoek
Reactive Streams - László van den Hoek
 
Streams of RDF Events Derive2015
Streams of RDF Events Derive2015Streams of RDF Events Derive2015
Streams of RDF Events Derive2015
 
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 ...
 
Spring Framework Tutorial for Beginners.pdf
Spring Framework Tutorial for Beginners.pdfSpring Framework Tutorial for Beginners.pdf
Spring Framework Tutorial for Beginners.pdf
 

Recently uploaded

MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...Nitya salvi
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...kalichargn70th171
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfproinshot.com
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxalwaysnagaraju26
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 

Recently uploaded (20)

MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 

Scala Italy 2015 - An Introduction to Akka and the Actor Based Model

  • 1. An Introduction to Akka and the Actor-Based Model Daniela Sfregola @DanielaSfregola http://danielasfregola.com/ Scala Italy 2015 An Introduction to Akka and the Actor-Based Model 1/14
  • 2. Outline Motivation: Concurrency Thread-Lock-Monitor Approach Message-Passing Approach Akka as Message-Passing Framework Actors in Akka Actor Life Cycle Actors Hierarchy Supervision Rules Demo An Introduction to Akka and the Actor-Based Model 2/14
  • 3. Motivation: Concurrency Low Cost Hardware Multiple Core CPUs Distributed Systems Big Data Parallelism We need to deal with shared resources between processes! An Introduction to Akka and the Actor-Based Model 3/14
  • 4. Thread-Lock-Monitor Approach Thread-Lock-Monitor approach can be challenging: Logic complicated for humans Difficult to design and maintain High unpredictability Do we have an easier approach to tackle concurrency problems? An Introduction to Akka and the Actor-Based Model 4/14
  • 5. Message-Passing Approach The Message-Passing Approach: Encapsulates all the shared information in messages Messages are used to communicate between processes An Introduction to Akka and the Actor-Based Model 5/14
  • 6. Akka as Message-Passing Framework Akka - from akka.io Build powerful concurrent & distributed applications more easily. Simple Concurrency & Distribution Resilient by Design High Performance Elastic & Decentralized Extensible It supports Scala, Java... .NET is coming soon! An Introduction to Akka and the Actor-Based Model 6/14
  • 7. Actors in Akka Lightweight concurrent entity Event-driven Mailbox of messages processed asynchronously Can hold status/mutability An Introduction to Akka and the Actor-Based Model 7/14
  • 8. Actor Life Cycle Akka in action (2013) by R. Roestenburg, R. Bakker and R. Williams. Shelter Island: Manning Publication An Introduction to Akka and the Actor-Based Model 8/14
  • 10. Supervision Rules Your Father is your Supervisor Every Actor has a Supervisor, but the Guardian Actor (/user) Your Children follow your destiny If unable to handle an exception, escalate it to your Supervisor If the Guardian Actor is unable to handle an exception, the system will shutdown An Introduction to Akka and the Actor-Based Model 10/14
  • 11. Actor Core Operations There are four core operations on Actors: create send become supervise An Introduction to Akka and the Actor-Based Model 11/14
  • 12. Demo Demo Time! Gist available at https://gist.github.com/DanielaSfregola/ 6dc52bffa2ed566de9b2 An Introduction to Akka and the Actor-Based Model 12/14
  • 13. Conclusions Akka as Message-Passing approach to concurrency Main components: Actors Best Practices: Never Block Communicate only via messages Messages should be immutable Messages should be complete and self-contained An Introduction to Akka and the Actor-Based Model 13/14
  • 14. Conclusions Akka as Message-Passing approach to concurrency Main components: Actors Best Practices: Never Block Communicate only via messages Messages should be immutable Messages should be complete and self-contained Thank you! An Introduction to Akka and the Actor-Based Model 14/14