SlideShare una empresa de Scribd logo
1 de 7
Introduction to Akka 1.2

          Mike Slinn
       SF Scala Meetup
        Nov 21, 2011
akka.actor.Actor
• Will replace scala.actors.Actor 'real soon
  now'
• Are managed by akka.actor.ActorRefs
• ActorRefs are opaque (cannot inspect Actor
  properties or call methods)
• Must communicate with Actors via messages sent
  to their ActorRef
Messages
• Arrive at actor mailboxes in the order they were
  sent.
• Actors can reply to messages, except
• Only Actors can receive messages
• If an actor is sent a message by a non-actor, no reply is possible
Actors and Dispatchers
•   Actors are scheduled by dispatchers
•   The default dispatcher works fine for many uses
•   Various dispatcher algorithms are available
•   Do not code to a specific dispatcher algorithm;
    the algorithm is usually defined in akka.conf
akka.stm.Ref
• STM: Software Transactional Memory
• Each Ref get/set is always atomic (wrapped in a
  transaction)
• Transactions are (relatively) expensive
How to Obtain Partial Simulation Results?
1.Create an inner class that accesses a property
  outside its scope, or
2.Use an STM Ref


• Inner class approach breaks OO encapsulation
Now we are ready to look at Hanuman

Más contenido relacionado

Destacado

Help u india online education portal. find colleges, institutes in india
Help u india  online education portal. find colleges, institutes in indiaHelp u india  online education portal. find colleges, institutes in india
Help u india online education portal. find colleges, institutes in indiaHelp u india
 
XML Amsterdam 2012 Keynote
XML Amsterdam 2012 KeynoteXML Amsterdam 2012 Keynote
XML Amsterdam 2012 Keynotejimfuller2009
 
Groovy on Android (as of 2016)
Groovy on Android (as of 2016)Groovy on Android (as of 2016)
Groovy on Android (as of 2016)Kevin H.A. Tan
 
2012 11-20 smc 070 bas hoogland
2012 11-20 smc 070 bas hoogland2012 11-20 smc 070 bas hoogland
2012 11-20 smc 070 bas hooglandSMC070
 
Maximize Your Social Media: Branding and Journalism
Maximize Your Social Media: Branding and JournalismMaximize Your Social Media: Branding and Journalism
Maximize Your Social Media: Branding and JournalismMandy Jenkins
 
Writing quality code, as a team.
Writing quality code, as a team.Writing quality code, as a team.
Writing quality code, as a team.e0ipso
 
What about-those-who-have-never-heard (1)
What about-those-who-have-never-heard (1)What about-those-who-have-never-heard (1)
What about-those-who-have-never-heard (1)SSMC
 
Raising godly children 19 jun 15
Raising godly children 19 jun 15Raising godly children 19 jun 15
Raising godly children 19 jun 15SSMC
 
Social Media Strategy for College Newsrooms
Social Media Strategy for College NewsroomsSocial Media Strategy for College Newsrooms
Social Media Strategy for College NewsroomsMandy Jenkins
 
02 06 Napoli Business
02 06 Napoli Business02 06 Napoli Business
02 06 Napoli BusinessClubIN
 

Destacado (14)

Certificate_1
Certificate_1Certificate_1
Certificate_1
 
Help u india online education portal. find colleges, institutes in india
Help u india  online education portal. find colleges, institutes in indiaHelp u india  online education portal. find colleges, institutes in india
Help u india online education portal. find colleges, institutes in india
 
XML Amsterdam 2012 Keynote
XML Amsterdam 2012 KeynoteXML Amsterdam 2012 Keynote
XML Amsterdam 2012 Keynote
 
Groovy on Android (as of 2016)
Groovy on Android (as of 2016)Groovy on Android (as of 2016)
Groovy on Android (as of 2016)
 
Scala at Netflix
Scala at NetflixScala at Netflix
Scala at Netflix
 
2012 11-20 smc 070 bas hoogland
2012 11-20 smc 070 bas hoogland2012 11-20 smc 070 bas hoogland
2012 11-20 smc 070 bas hoogland
 
Mc Farland Studer
Mc Farland StuderMc Farland Studer
Mc Farland Studer
 
Daren Brabham Stakeholder Engagement Conference 2010
Daren Brabham Stakeholder Engagement Conference 2010Daren Brabham Stakeholder Engagement Conference 2010
Daren Brabham Stakeholder Engagement Conference 2010
 
Maximize Your Social Media: Branding and Journalism
Maximize Your Social Media: Branding and JournalismMaximize Your Social Media: Branding and Journalism
Maximize Your Social Media: Branding and Journalism
 
Writing quality code, as a team.
Writing quality code, as a team.Writing quality code, as a team.
Writing quality code, as a team.
 
What about-those-who-have-never-heard (1)
What about-those-who-have-never-heard (1)What about-those-who-have-never-heard (1)
What about-those-who-have-never-heard (1)
 
Raising godly children 19 jun 15
Raising godly children 19 jun 15Raising godly children 19 jun 15
Raising godly children 19 jun 15
 
Social Media Strategy for College Newsrooms
Social Media Strategy for College NewsroomsSocial Media Strategy for College Newsrooms
Social Media Strategy for College Newsrooms
 
02 06 Napoli Business
02 06 Napoli Business02 06 Napoli Business
02 06 Napoli Business
 

Más de Mike Slinn

Evaluating Blockchain Companies
Evaluating Blockchain CompaniesEvaluating Blockchain Companies
Evaluating Blockchain CompaniesMike Slinn
 
Fullsize Smart Contracts That Learn
Fullsize Smart Contracts That Learn Fullsize Smart Contracts That Learn
Fullsize Smart Contracts That Learn Mike Slinn
 
Dotty (Scala 3) Preview
Dotty (Scala 3) PreviewDotty (Scala 3) Preview
Dotty (Scala 3) PreviewMike Slinn
 
EmpathyWorks – Towards an Event-Based Simulation/ML Hybrid Platform
EmpathyWorks – Towards an Event-Based Simulation/ML Hybrid PlatformEmpathyWorks – Towards an Event-Based Simulation/ML Hybrid Platform
EmpathyWorks – Towards an Event-Based Simulation/ML Hybrid PlatformMike Slinn
 
Smart Contracts That Learn
Smart Contracts That LearnSmart Contracts That Learn
Smart Contracts That LearnMike Slinn
 
Polyglot Ethereum - Smart Contracts for the Enterprise
Polyglot Ethereum - Smart Contracts for the EnterprisePolyglot Ethereum - Smart Contracts for the Enterprise
Polyglot Ethereum - Smart Contracts for the EnterpriseMike Slinn
 
Play Architecture, Implementation, Shiny Objects, and a Proposal
Play Architecture, Implementation, Shiny Objects, and a ProposalPlay Architecture, Implementation, Shiny Objects, and a Proposal
Play Architecture, Implementation, Shiny Objects, and a ProposalMike Slinn
 
Adobe Flash Platform for the Enterprise
Adobe Flash Platform for the EnterpriseAdobe Flash Platform for the Enterprise
Adobe Flash Platform for the EnterpriseMike Slinn
 

Más de Mike Slinn (8)

Evaluating Blockchain Companies
Evaluating Blockchain CompaniesEvaluating Blockchain Companies
Evaluating Blockchain Companies
 
Fullsize Smart Contracts That Learn
Fullsize Smart Contracts That Learn Fullsize Smart Contracts That Learn
Fullsize Smart Contracts That Learn
 
Dotty (Scala 3) Preview
Dotty (Scala 3) PreviewDotty (Scala 3) Preview
Dotty (Scala 3) Preview
 
EmpathyWorks – Towards an Event-Based Simulation/ML Hybrid Platform
EmpathyWorks – Towards an Event-Based Simulation/ML Hybrid PlatformEmpathyWorks – Towards an Event-Based Simulation/ML Hybrid Platform
EmpathyWorks – Towards an Event-Based Simulation/ML Hybrid Platform
 
Smart Contracts That Learn
Smart Contracts That LearnSmart Contracts That Learn
Smart Contracts That Learn
 
Polyglot Ethereum - Smart Contracts for the Enterprise
Polyglot Ethereum - Smart Contracts for the EnterprisePolyglot Ethereum - Smart Contracts for the Enterprise
Polyglot Ethereum - Smart Contracts for the Enterprise
 
Play Architecture, Implementation, Shiny Objects, and a Proposal
Play Architecture, Implementation, Shiny Objects, and a ProposalPlay Architecture, Implementation, Shiny Objects, and a Proposal
Play Architecture, Implementation, Shiny Objects, and a Proposal
 
Adobe Flash Platform for the Enterprise
Adobe Flash Platform for the EnterpriseAdobe Flash Platform for the Enterprise
Adobe Flash Platform for the Enterprise
 

Último

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 

Último (20)

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 

Introduction to akka

  • 1. Introduction to Akka 1.2 Mike Slinn SF Scala Meetup Nov 21, 2011
  • 2. akka.actor.Actor • Will replace scala.actors.Actor 'real soon now' • Are managed by akka.actor.ActorRefs • ActorRefs are opaque (cannot inspect Actor properties or call methods) • Must communicate with Actors via messages sent to their ActorRef
  • 3. Messages • Arrive at actor mailboxes in the order they were sent. • Actors can reply to messages, except • Only Actors can receive messages • If an actor is sent a message by a non-actor, no reply is possible
  • 4. Actors and Dispatchers • Actors are scheduled by dispatchers • The default dispatcher works fine for many uses • Various dispatcher algorithms are available • Do not code to a specific dispatcher algorithm; the algorithm is usually defined in akka.conf
  • 5. akka.stm.Ref • STM: Software Transactional Memory • Each Ref get/set is always atomic (wrapped in a transaction) • Transactions are (relatively) expensive
  • 6. How to Obtain Partial Simulation Results? 1.Create an inner class that accesses a property outside its scope, or 2.Use an STM Ref • Inner class approach breaks OO encapsulation
  • 7. Now we are ready to look at Hanuman