SlideShare una empresa de Scribd logo
1 de 23
Descargar para leer sin conexión
Akka:
 The Smash and Grab Intro
  The Basics of Sane Concurrency

 Jeremy Pierre
 Yet Another Developer
 @ j14159


twitter.com/hootsuite   facebook.com/hootsuite   slideshare.com/hootsuite   blog.hootsuite.com
Akka What?


                                 Don’t call it a framework

                                                   So...?

         A toolkit for sane concurrency.
                        • Not just about actors
                        • Blocking is bad, event-based is good
                        • Crashing is not the end of the world




twitter.com/hootsuite            facebook.com/hootsuite     slideshare.com/hootsuite   blog.hootsuite.com
The Overview
 What I’ll Cover:
                        • Actors and ActorSystems
                        • Supervision(in passing)
                        • Futures and Promises
                        • Some interesting stuff with execution
                        contexts, event buses and schedulers




twitter.com/hootsuite           facebook.com/hootsuite   slideshare.com/hootsuite   blog.hootsuite.com
The Overview
 What I’ll Cover:
                        • Actors and ActorSystems
                        • Supervision(in passing)
                        • Futures and Promises
                        • Some interesting stuff with execution
                        contexts, event buses and schedulers
 What I’m Not Covering

                        • Remoting
                        • FSM
                        • Routing/Dispatchers
                        • IO


twitter.com/hootsuite           facebook.com/hootsuite   slideshare.com/hootsuite   blog.hootsuite.com
To help it all make sense...

    We use the Librarian Problem:

• A Library has one Librarian but many Interns.
• Interns do not know where to find specific books.
• The Librarian can’t go find books for customers because they can then only help one
at a time.

• If the Librarian tells the Interns where to find stuff, many book requests can be
handled at the same time.




   twitter.com/hootsuite   facebook.com/hootsuite     slideshare.com/hootsuite   blog.hootsuite.com
Akka Actors

       The logical extreme of OOP and Information Hiding



• There’s only one method
to make it do stuff(tell / !)
• They’re purely event-
based
• They live in ActorSystems




    twitter.com/hootsuite   facebook.com/hootsuite   slideshare.com/hootsuite   blog.hootsuite.com
ActorSystem




            • They make ActorRefs
            • They’re the root of a hierarchy(think file system)




twitter.com/hootsuite   facebook.com/hootsuite   slideshare.com/hootsuite   blog.hootsuite.com
ActorSystem




            • They make ActorRefs
            • They’re the root of a hierarchy(think file system)




twitter.com/hootsuite   facebook.com/hootsuite   slideshare.com/hootsuite   blog.hootsuite.com
ActorSystem




            • They make ActorRefs
            • They’re the root of a hierarchy(think file system)




twitter.com/hootsuite   facebook.com/hootsuite   slideshare.com/hootsuite   blog.hootsuite.com
Futures...

   ...let us do asynchronous stuff without an Actor




                        But where’s the result?




twitter.com/hootsuite   facebook.com/hootsuite   slideshare.com/hootsuite   blog.hootsuite.com
Futures...

   ...let us do asynchronous stuff without an Actor




                        But where’s the result?




twitter.com/hootsuite   facebook.com/hootsuite   slideshare.com/hootsuite   blog.hootsuite.com
Promises

 The “write” side of Futures




                        But that looks kind of boring...




twitter.com/hootsuite       facebook.com/hootsuite   slideshare.com/hootsuite   blog.hootsuite.com
Promises

 The “write” side of Futures




                        But that looks kind of boring...




twitter.com/hootsuite       facebook.com/hootsuite   slideshare.com/hootsuite   blog.hootsuite.com
One more Promise




twitter.com/hootsuite   facebook.com/hootsuite   slideshare.com/hootsuite   blog.hootsuite.com
Using the results of Future/Promise

       As you’d expect, this gives you another Future:



                        This callback is for side-effecting:




twitter.com/hootsuite         facebook.com/hootsuite   slideshare.com/hootsuite   blog.hootsuite.com
Event Bus and Scheduler

 EventBus is (very) simple pub-sub for Actors:




twitter.com/hootsuite   facebook.com/hootsuite   slideshare.com/hootsuite   blog.hootsuite.com
Event Bus and Scheduler

  EventBus is (very) simple pub-sub for Actors:




                                    Scheduler?
"Thread.sleep is never fine. It's like drowning a kitten."
                    - @viktorklang
 twitter.com/hootsuite   facebook.com/hootsuite   slideshare.com/hootsuite   blog.hootsuite.com
Event Bus and Scheduler

 EventBus is (very) simple pub-sub for Actors:




 Scheduler makes stuff happen when you want it to:




twitter.com/hootsuite   facebook.com/hootsuite   slideshare.com/hootsuite   blog.hootsuite.com
Asking and Piping
   import akka.pattern.ask




twitter.com/hootsuite   facebook.com/hootsuite   slideshare.com/hootsuite   blog.hootsuite.com
Asking and Piping
   import akka.pattern.ask




   import akka.pattern.pipe




twitter.com/hootsuite   facebook.com/hootsuite   slideshare.com/hootsuite   blog.hootsuite.com
ExecutionContext

 Futures and Promises need it


 • It basically hides a java.util.concurrent.Executor
 • Your ActorSystem’s dispatcher is one
 • You can create them via configuration or programmatically




twitter.com/hootsuite   facebook.com/hootsuite   slideshare.com/hootsuite   blog.hootsuite.com
Mix Them!




Never block your ActorSystem’s threads for DB calls!

twitter.com/hootsuite   facebook.com/hootsuite   slideshare.com/hootsuite   blog.hootsuite.com
Thank You!
 Jeremy Pierre
 Yet Another Developer
 @j14159



twitter.com/hootsuite   facebook.com/hootsuite   slideshare.com/hootsuite   blog.hootsuite.com

Más contenido relacionado

Similar a Akka smash-and-grab

Give them homework they will love rs
Give them homework they will love rsGive them homework they will love rs
Give them homework they will love rsNatasa Bozic Grojic
 
Make Stuff People Can Use - Agile Alliance 2010
Make Stuff People Can Use - Agile Alliance 2010Make Stuff People Can Use - Agile Alliance 2010
Make Stuff People Can Use - Agile Alliance 2010Samantha Starmer
 
Powerpoint: taking a 20th century tool into the 21st century classroom
Powerpoint: taking a 20th century tool into the 21st century classroomPowerpoint: taking a 20th century tool into the 21st century classroom
Powerpoint: taking a 20th century tool into the 21st century classroomNaomi Bates
 
The Great Eleven - Ohio Version
The Great Eleven - Ohio VersionThe Great Eleven - Ohio Version
The Great Eleven - Ohio VersionChristopher Bugaj
 
Give them homework they will love rsss
Give them homework they will love rsssGive them homework they will love rsss
Give them homework they will love rsssNatasa Bozic Grojic
 
Ohio Innovative Learning Digital Wriitng
Ohio Innovative Learning Digital WriitngOhio Innovative Learning Digital Wriitng
Ohio Innovative Learning Digital WriitngFranki22
 
Region 11 Main Presentation-Flipped Learning
Region 11 Main Presentation-Flipped LearningRegion 11 Main Presentation-Flipped Learning
Region 11 Main Presentation-Flipped LearningJon Bergmann
 
Social Media Tools That Work
Social Media Tools That WorkSocial Media Tools That Work
Social Media Tools That WorkJeffrey L. Cohen
 
In It Together: Co-Creating Your Content Strategy
In It Together: Co-Creating Your Content StrategyIn It Together: Co-Creating Your Content Strategy
In It Together: Co-Creating Your Content StrategySara Wachter-Boettcher
 
TCCA 2014 Apps presentatio
TCCA 2014 Apps presentatioTCCA 2014 Apps presentatio
TCCA 2014 Apps presentatioKarin Perry
 
Twitter For Education and Private Schools - Webinar 10/23/12
Twitter For Education and Private Schools - Webinar 10/23/12Twitter For Education and Private Schools - Webinar 10/23/12
Twitter For Education and Private Schools - Webinar 10/23/12Evolving SEO
 
Smash Summit 2011: YouTube
Smash Summit 2011: YouTubeSmash Summit 2011: YouTube
Smash Summit 2011: YouTubeShiva Rajaraman
 
Blogging-This is an assignment for a course at Minnesota State University, Ma...
Blogging-This is an assignment for a course at Minnesota State University, Ma...Blogging-This is an assignment for a course at Minnesota State University, Ma...
Blogging-This is an assignment for a course at Minnesota State University, Ma...booerin
 
To Tweet or Not to Tweet - for Construction Professionals
To Tweet or Not to Tweet - for Construction ProfessionalsTo Tweet or Not to Tweet - for Construction Professionals
To Tweet or Not to Tweet - for Construction ProfessionalsSu Butcher
 
Developing Effective Presentations
Developing Effective PresentationsDeveloping Effective Presentations
Developing Effective PresentationsLaDonna Coy
 
Power Up Your PLN Revised
Power Up Your PLN RevisedPower Up Your PLN Revised
Power Up Your PLN RevisedJennifer Dorman
 
Twitter apps - Pubcon2010
Twitter apps - Pubcon2010Twitter apps - Pubcon2010
Twitter apps - Pubcon2010Brian Breslin
 

Similar a Akka smash-and-grab (20)

Give them homework they will love rs
Give them homework they will love rsGive them homework they will love rs
Give them homework they will love rs
 
Make Stuff People Can Use - Agile Alliance 2010
Make Stuff People Can Use - Agile Alliance 2010Make Stuff People Can Use - Agile Alliance 2010
Make Stuff People Can Use - Agile Alliance 2010
 
Technologies
Technologies Technologies
Technologies
 
TwitterPD
TwitterPDTwitterPD
TwitterPD
 
Powerpoint: taking a 20th century tool into the 21st century classroom
Powerpoint: taking a 20th century tool into the 21st century classroomPowerpoint: taking a 20th century tool into the 21st century classroom
Powerpoint: taking a 20th century tool into the 21st century classroom
 
The Great Eleven - Ohio Version
The Great Eleven - Ohio VersionThe Great Eleven - Ohio Version
The Great Eleven - Ohio Version
 
Give them homework they will love rsss
Give them homework they will love rsssGive them homework they will love rsss
Give them homework they will love rsss
 
Ohio Innovative Learning Digital Wriitng
Ohio Innovative Learning Digital WriitngOhio Innovative Learning Digital Wriitng
Ohio Innovative Learning Digital Wriitng
 
Region 11 Main Presentation-Flipped Learning
Region 11 Main Presentation-Flipped LearningRegion 11 Main Presentation-Flipped Learning
Region 11 Main Presentation-Flipped Learning
 
Social Media Tools That Work
Social Media Tools That WorkSocial Media Tools That Work
Social Media Tools That Work
 
In It Together: Co-Creating Your Content Strategy
In It Together: Co-Creating Your Content StrategyIn It Together: Co-Creating Your Content Strategy
In It Together: Co-Creating Your Content Strategy
 
TCCA 2014 Apps presentatio
TCCA 2014 Apps presentatioTCCA 2014 Apps presentatio
TCCA 2014 Apps presentatio
 
Twitter For Education and Private Schools - Webinar 10/23/12
Twitter For Education and Private Schools - Webinar 10/23/12Twitter For Education and Private Schools - Webinar 10/23/12
Twitter For Education and Private Schools - Webinar 10/23/12
 
Smash Summit 2011: YouTube
Smash Summit 2011: YouTubeSmash Summit 2011: YouTube
Smash Summit 2011: YouTube
 
Blogging-This is an assignment for a course at Minnesota State University, Ma...
Blogging-This is an assignment for a course at Minnesota State University, Ma...Blogging-This is an assignment for a course at Minnesota State University, Ma...
Blogging-This is an assignment for a course at Minnesota State University, Ma...
 
ontopwiki.pdf
ontopwiki.pdfontopwiki.pdf
ontopwiki.pdf
 
To Tweet or Not to Tweet - for Construction Professionals
To Tweet or Not to Tweet - for Construction ProfessionalsTo Tweet or Not to Tweet - for Construction Professionals
To Tweet or Not to Tweet - for Construction Professionals
 
Developing Effective Presentations
Developing Effective PresentationsDeveloping Effective Presentations
Developing Effective Presentations
 
Power Up Your PLN Revised
Power Up Your PLN RevisedPower Up Your PLN Revised
Power Up Your PLN Revised
 
Twitter apps - Pubcon2010
Twitter apps - Pubcon2010Twitter apps - Pubcon2010
Twitter apps - Pubcon2010
 

Último

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 2024The Digital Insurer
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
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.pptxHampshireHUG
 
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 Processorsdebabhi2
 
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...Martijn de Jong
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
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 productivityPrincipled Technologies
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
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 2024The Digital Insurer
 

Último (20)

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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
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
 
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
 
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...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
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
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
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
 

Akka smash-and-grab

  • 1. Akka: The Smash and Grab Intro The Basics of Sane Concurrency Jeremy Pierre Yet Another Developer @ j14159 twitter.com/hootsuite facebook.com/hootsuite slideshare.com/hootsuite blog.hootsuite.com
  • 2. Akka What? Don’t call it a framework So...? A toolkit for sane concurrency. • Not just about actors • Blocking is bad, event-based is good • Crashing is not the end of the world twitter.com/hootsuite facebook.com/hootsuite slideshare.com/hootsuite blog.hootsuite.com
  • 3. The Overview What I’ll Cover: • Actors and ActorSystems • Supervision(in passing) • Futures and Promises • Some interesting stuff with execution contexts, event buses and schedulers twitter.com/hootsuite facebook.com/hootsuite slideshare.com/hootsuite blog.hootsuite.com
  • 4. The Overview What I’ll Cover: • Actors and ActorSystems • Supervision(in passing) • Futures and Promises • Some interesting stuff with execution contexts, event buses and schedulers What I’m Not Covering • Remoting • FSM • Routing/Dispatchers • IO twitter.com/hootsuite facebook.com/hootsuite slideshare.com/hootsuite blog.hootsuite.com
  • 5. To help it all make sense... We use the Librarian Problem: • A Library has one Librarian but many Interns. • Interns do not know where to find specific books. • The Librarian can’t go find books for customers because they can then only help one at a time. • If the Librarian tells the Interns where to find stuff, many book requests can be handled at the same time. twitter.com/hootsuite facebook.com/hootsuite slideshare.com/hootsuite blog.hootsuite.com
  • 6. Akka Actors The logical extreme of OOP and Information Hiding • There’s only one method to make it do stuff(tell / !) • They’re purely event- based • They live in ActorSystems twitter.com/hootsuite facebook.com/hootsuite slideshare.com/hootsuite blog.hootsuite.com
  • 7. ActorSystem • They make ActorRefs • They’re the root of a hierarchy(think file system) twitter.com/hootsuite facebook.com/hootsuite slideshare.com/hootsuite blog.hootsuite.com
  • 8. ActorSystem • They make ActorRefs • They’re the root of a hierarchy(think file system) twitter.com/hootsuite facebook.com/hootsuite slideshare.com/hootsuite blog.hootsuite.com
  • 9. ActorSystem • They make ActorRefs • They’re the root of a hierarchy(think file system) twitter.com/hootsuite facebook.com/hootsuite slideshare.com/hootsuite blog.hootsuite.com
  • 10. Futures... ...let us do asynchronous stuff without an Actor But where’s the result? twitter.com/hootsuite facebook.com/hootsuite slideshare.com/hootsuite blog.hootsuite.com
  • 11. Futures... ...let us do asynchronous stuff without an Actor But where’s the result? twitter.com/hootsuite facebook.com/hootsuite slideshare.com/hootsuite blog.hootsuite.com
  • 12. Promises The “write” side of Futures But that looks kind of boring... twitter.com/hootsuite facebook.com/hootsuite slideshare.com/hootsuite blog.hootsuite.com
  • 13. Promises The “write” side of Futures But that looks kind of boring... twitter.com/hootsuite facebook.com/hootsuite slideshare.com/hootsuite blog.hootsuite.com
  • 14. One more Promise twitter.com/hootsuite facebook.com/hootsuite slideshare.com/hootsuite blog.hootsuite.com
  • 15. Using the results of Future/Promise As you’d expect, this gives you another Future: This callback is for side-effecting: twitter.com/hootsuite facebook.com/hootsuite slideshare.com/hootsuite blog.hootsuite.com
  • 16. Event Bus and Scheduler EventBus is (very) simple pub-sub for Actors: twitter.com/hootsuite facebook.com/hootsuite slideshare.com/hootsuite blog.hootsuite.com
  • 17. Event Bus and Scheduler EventBus is (very) simple pub-sub for Actors: Scheduler? "Thread.sleep is never fine. It's like drowning a kitten." - @viktorklang twitter.com/hootsuite facebook.com/hootsuite slideshare.com/hootsuite blog.hootsuite.com
  • 18. Event Bus and Scheduler EventBus is (very) simple pub-sub for Actors: Scheduler makes stuff happen when you want it to: twitter.com/hootsuite facebook.com/hootsuite slideshare.com/hootsuite blog.hootsuite.com
  • 19. Asking and Piping import akka.pattern.ask twitter.com/hootsuite facebook.com/hootsuite slideshare.com/hootsuite blog.hootsuite.com
  • 20. Asking and Piping import akka.pattern.ask import akka.pattern.pipe twitter.com/hootsuite facebook.com/hootsuite slideshare.com/hootsuite blog.hootsuite.com
  • 21. ExecutionContext Futures and Promises need it • It basically hides a java.util.concurrent.Executor • Your ActorSystem’s dispatcher is one • You can create them via configuration or programmatically twitter.com/hootsuite facebook.com/hootsuite slideshare.com/hootsuite blog.hootsuite.com
  • 22. Mix Them! Never block your ActorSystem’s threads for DB calls! twitter.com/hootsuite facebook.com/hootsuite slideshare.com/hootsuite blog.hootsuite.com
  • 23. Thank You! Jeremy Pierre Yet Another Developer @j14159 twitter.com/hootsuite facebook.com/hootsuite slideshare.com/hootsuite blog.hootsuite.com