SlideShare uma empresa Scribd logo
1 de 23
Baixar para ler 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

Mais conteúdo relacionado

Semelhante 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
 

Semelhante 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

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
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
 
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
 
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
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
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
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 

Último (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
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
 
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
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

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