SlideShare a Scribd company logo
1 of 23
Download to read offline
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

More Related Content

Similar to 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 to 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
 

Recently uploaded

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
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
 
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
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
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
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
[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
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Recently uploaded (20)

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
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
 
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
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
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...
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
[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
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

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