Akka.NET Fundamentals — #ProgNet15

2,441 views

Published on

Akka.NET Fundamentals workshop at the #ProgNet15 conference in London, July 2015.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,441
On SlideShare
0
From Embeds
0
Number of Embeds
1,326
Actions
Shares
0
Downloads
24
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Akka.NET Fundamentals — #ProgNet15

  1. 1. @petabridge Petabridge.com @AkkaDotNet - #ProgNet15 Andrew  Skotzko   Co-­‐founder  —  Petabridge  
  2. 2. @petabridge Petabridge.com What  do  you   want?  
  3. 3. @petabridge Petabridge.com What You’ll Get Today •  Understand actor model •  New possibilities •  Hands-on: learn Akka.NET fundamentals •  Glimpse where this could take you
  4. 4. @petabridge Petabridge.com Why  should  we   care  about   concurrency?  
  5. 5. @petabridge Petabridge.com 1970  -­‐  2005  
  6. 6. @petabridge Petabridge.com
  7. 7. @petabridge Petabridge.com
  8. 8. @petabridge Petabridge.com
  9. 9. @petabridge Petabridge.com
  10. 10. @petabridge Petabridge.com
  11. 11. @petabridge Petabridge.com
  12. 12. @petabridge Petabridge.com TANSTAAFL   “There  ain’t  no  such  thing  as  a  free  lunch.”   —R.  A.  Heinlein,  The  Moon  Is  a  Harsh  Mistress  
  13. 13. @petabridge Petabridge.com What  the  hell  are   you  talking   about?  
  14. 14. @petabridge Petabridge.com Concurrency.   We  needs  it.  
  15. 15. @petabridge Petabridge.com So  why  is  this  hard?  
  16. 16. @petabridge Petabridge.com How to Write Multithreaded Code
  17. 17. @petabridge Petabridge.com Shared State Programming Sucks (Illustrated)
  18. 18. @petabridge Petabridge.com Random? •  .NET 4.0: TPL (2010) •  .NET 4.5: async/await (2012)
  19. 19. @petabridge Petabridge.com Is there a better way? THERE MUST BE! THERE.   MUST.   BE.   A.   BETTER.   WAY!  
  20. 20. @petabridge Petabridge.com Warning! Mind Blowingly Different Programming Style Ahead!
  21. 21. @petabridge Petabridge.com Warning! Mind Blowingly Different Programming Style Ahead!
  22. 22. @petabridge Petabridge.com The Actor Model
  23. 23. @petabridge Petabridge.com What  is  the  actor  model?  
  24. 24. @petabridge Petabridge.com Everything  is  an  actor.  
  25. 25. @petabridge Petabridge.com
  26. 26. @petabridge Petabridge.com
  27. 27. @petabridge Petabridge.com 3 Core Abilities 1.  Send  messages   2.  Create  other  actors   3.  Change  behavior  
  28. 28. @petabridge Petabridge.com Messages
  29. 29. @petabridge Petabridge.com Actors work by passing each other messages
  30. 30. @petabridge Petabridge.com Message passing in action
  31. 31. @petabridge Petabridge.com BUZZWORD   BINGO!  
  32. 32. @petabridge Petabridge.com Example Akka.NET Message
  33. 33. @petabridge Petabridge.com Actors send messages to addresses
  34. 34. @petabridge Petabridge.com Actor addresses have location transparency
  35. 35. @petabridge Petabridge.com Which means…
  36. 36. @petabridge Petabridge.com
  37. 37. @petabridge Petabridge.com
  38. 38. @petabridge Petabridge.com ReactiveManifesto.org
  39. 39. @petabridge Petabridge.com What is Akka.NET?
  40. 40. @petabridge Petabridge.com Battle-Tested (JVM)
  41. 41. @petabridge Petabridge.com This is an actor
  42. 42. @petabridge Petabridge.com These are messages
  43. 43. @petabridge Petabridge.com Actors run on threads
  44. 44. @petabridge Petabridge.com Actors are lazy
  45. 45. @petabridge Petabridge.com Process messages one at a time
  46. 46. @petabridge Petabridge.com The circle of life
  47. 47. @petabridge Petabridge.com
  48. 48. @petabridge Petabridge.com Hierarchies
  49. 49. @petabridge Petabridge.com Supervision
  50. 50. @petabridge Petabridge.com Switchable Behavior
  51. 51. @petabridge Petabridge.com And Can Form Highly Available Systems
  52. 52. @petabridge Petabridge.com Actors    Vs.   C#  Classes  
  53. 53. @petabridge Petabridge.com What’s  this  give   me?  
  54. 54. @petabridge Petabridge.com Where can I use this? •  Analytics systems •  Marketing automation •  Multi-player games •  Device / IoT tracking •  Alerting & monitoring systems •  Recommendation engines •  Dynamic pricing •  Reactive UI
  55. 55. @petabridge Petabridge.com DEMO  
  56. 56. @petabridge Petabridge.com 10min  break  
  57. 57. @petabridge Petabridge.com EXERCISE:   Port  Tail  from  *nix  to  Windows.  
  58. 58. @petabridge Petabridge.com Materials   haps://petabridge.com/cheatsheet  
  59. 59. @petabridge Petabridge.com Make   ActorSystem  +   First  Actors  
  60. 60. @petabridge Petabridge.com Define  first   messages  
  61. 61. @petabridge Petabridge.com Props  &   IActorRefs  
  62. 62. @petabridge Petabridge.com Hierarchies  &   Child  Actors  
  63. 63. @petabridge Petabridge.com Hierarchies pt. deux
  64. 64. @petabridge Petabridge.com Character Actor Pattern
  65. 65. @petabridge Petabridge.com ActorSelecgon  
  66. 66. @petabridge Petabridge.com ActorSelection == selection by address
  67. 67. @petabridge Petabridge.com Actor  Lifecycle  
  68. 68. @petabridge Petabridge.com Actor lifecycle
  69. 69. @petabridge Petabridge.com Actor lifecycle
  70. 70. @petabridge Petabridge.com Next Steps 1)  Use  your  cheatsheet!   2)  Finish  Bootcamp   3)  Use  Giaer  chat   4)  Get  your  prize!  
  71. 71. @petabridge Petabridge.com Get your prize! haps://petabridge.com/prognet  
  72. 72. @petabridge Petabridge.com THANK YOU! Email:  andrew@petabridge.com     Twiaerz:     @askotzko   @AkkaDotNet  
  73. 73. @petabridge Petabridge.com hap://LearnAkka.net  

×