SlideShare uma empresa 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

Mais conteúdo relacionado

Destaque

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
 

Destaque (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
 

Mais 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
 

Mais 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

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
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
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
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
 
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
 
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
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
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
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
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
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 

Último (20)

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
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
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
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
 
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
 
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
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
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
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 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