Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

今日こそ理解するHot / Cold @社内RxSwift勉強会

4,747 views

Published on

Rx ( RxSwift) における Hot / Cold の性質の説明です。

Published in: Engineering
  • Be the first to comment

今日こそ理解するHot / Cold @社内RxSwift勉強会

  1. 1. Hot / Cold @ RxSwift
  2. 2. Rx
  3. 3. Hot / Cold
  4. 4. Hot / Cold • Hot / Cold • Hot / Cold • Hot / Cold • Rx … Rx …
  5. 5. ( ^o^)
  6. 6. ( ^o^) ※ Bond
  7. 7. • Hot / Cold RxSwift
  8. 8. • Hot • Hot / Cold
  9. 9. • ( ) Hot / Cold •
  10. 10. 1 Hot / Cold Observable
  11. 11. Observable
  12. 12. Observable • Subject • PublishSubject, BehaviorSubject, ReplaySubject …
  13. 13. Observable • Subject • PublishSubject, BehaviorSubject, ReplaySubject … • Operator • map, filter, flatMap … • create, of, just, error …
  14. 14. Observable • Subject • PublishSubject, BehaviorSubject, ReplaySubject … • Operator ← !? • map, filter, flatMap … • create, of, just, error …
  15. 15. 2 Operator ( ) Observable
  16. 16. filter
  17. 17. filter Observable
  18. 18. filter filter operator Filter
  19. 19. just
  20. 20. just Observable
  21. 21. just Just
  22. 22. • Hot / Cold Observable • Subject Observable • Operator ( ) Observable
  23. 23. Hot / Cold
  24. 24. 1 Subject Hot
  25. 25. Subject • PublishSubject • BehaviorSubject • ReplaySubject Hot
  26. 26. 2 Operator Cold
  27. 27. Hot Hot Hot • multicast / publish • replay / replayAll • connect / refCount • share / shareReplay • shareReplayLatestWhileConnected
  28. 28. Subject Hot
  29. 29. Map Operator Cold
  30. 30. Filter Operator Cold
  31. 31. Subject Map Filter ↑
  32. 32. • Subject Hot • Operator Cold • publish Operator Hot ( )
  33. 33. Hot / Cold
  34. 34. Hot / Cold
  35. 35. Question1
  36. 36. Answer …
  37. 37. A.
  38. 38. Cold 1 Cold Observable subscribe
  39. 39. Cold subscribe Sequence
  40. 40. Cold subscribe Sequence Map
  41. 41. Cold subscribe subscribe →
  42. 42. subscribe
  43. 43. subscribe
  44. 44. Hot 1 Hot Observable subscribe
  45. 45. Question2
  46. 46. Answer …
  47. 47. A.
  48. 48. Subject Map
  49. 49. Subject Map
  50. 50. • = Cold subscribe Subject Map Subject
  51. 51. Question3
  52. 52. Answer …
  53. 53. A. 1, 2, 3
  54. 54. Subject Map Hot
  55. 55. Hot Cold Hot Observable subscribe Subject Map Hot subscribe
  56. 56. • Cold Observable subscribe • Hot Observable subscribe • Hot Observable Cold
  57. 57. Hot
  58. 58. Hot 2 Hot Observable
  59. 59. Cold 2 Cold Observable
  60. 60. • = Observer • Cold Observable Observer 1 • Hot Observable Observer ※ Observer Observable
  61. 61. Sequence Map
  62. 62. Sequence Map Observer 1 subscribe
  63. 63. Sequence Map Observer Map Observer 2 subscribe 1 …
  64. 64. Sequence Map Observer Map Observer
  65. 65. Sequence Map Observer Sequence Map Observer
  66. 66. Sequence Map Observer Sequence Map Observer 2 !!
  67. 67. Sequence Map Observer Sequence Map Observer 2
  68. 68. Hot Hot ( ) ( Hot )
  69. 69. Hot
  70. 70. Hot ( Hot )
  71. 71. Hot Sequence Map Hot
  72. 72. Hot Sequence Map Hot Observer 1 subscribe
  73. 73. Hot Sequence Map Hot Observer Observer 2 subscribe
  74. 74. Hot Sequence Map Observer Hot Observer
  75. 75. Hot Sequence Map Observer Hot Observer !!!
  76. 76. Sequence Map Observer Hot Observer print
  77. 77. • Cold Observable • Hot Observable
  78. 78. Hot
  79. 79. Question4
  80. 80. ( Hot ) Hot ( )
  81. 81. Answer …
  82. 82. A. 2, 4, 6
  83. 83. 2 subscribe
  84. 84. Hot 3 Hot Observable Observer
  85. 85. • Observer Cold ( ) • (Next) subscribe
  86. 86. observer 1
  87. 87. 2,4,6
  88. 88. Next
  89. 89. Cold
  90. 90. Cold Sequence Map Observer Sequence Map Observer
  91. 91. Cold 2 Observer Sequence Map Observer Sequence Map Observer
  92. 92. Cold
  93. 93. Cold 1 Cold Observable subscribe
  94. 94. Hot 1 Hot Observable subscribe
  95. 95. Hot 2 Hot Observable
  96. 96. Cold 2 Cold Observable
  97. 97. Hot 3 Hot Observable Observer
  98. 98. • ( ) • Hot

×