Successfully reported this slideshow.
Your SlideShare is downloading. ×

マルチスレッドRxSwift @ 社内RxSwift勉強会

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad

Check these out next

1 of 138 Ad

More Related Content

Recently uploaded (20)

Advertisement

マルチスレッドRxSwift @ 社内RxSwift勉強会

  1. 1. RxSwift @ RxSwift
  2. 2. https://https://speakerdeck.com/ukitaka/rxswift-kodorideingufalsekan-suo-at-she-nei-rxswiftmian-qiang-hui/bricklife/rxswiftfalseobserveontosubscribeonwoli-jie-suru
  3. 3. • subscribe • subscribe subscribe Operator source subscribe
  4. 4. • RxSwift GCD • observeOn subscribeOn
  5. 5. • iOS • • (RxSwift ) GCD NSOperationQueue
  6. 6. • RxSwift v2.5.0 (2016 7 master) • 1
  7. 7. Observable
  8. 8. 1 Cold Operator subscribe subscribe on on
  9. 9. 1( ) Scheduler create Operator subscribe on
  10. 10. Sequence Observer
  11. 11. Sequence Observer subscribe
  12. 12. Sequence Observer subscribe on
  13. 13. Question1
  14. 14. Map
  15. 15. Answer …
  16. 16. A.
  17. 17. Sequence Map Observer subscribe
  18. 18. subscribe Sequence Map Observer subscribe source subscribe
  19. 19. subscribe Sequence Map Observer subscribe subscribe on
  20. 20. subscribe Sequence Map Observer subscribe on on
  21. 21. Question2
  22. 22. Map
  23. 23. Answer …
  24. 24. A.
  25. 25. Sequence Map ObserverPublish
  26. 26. Sequence Map ObserverPublish subscribe
  27. 27. Sequence Map Observer subscribe Publish subscribe
  28. 28. subscribe Sequence Map Observer subscribe Publish subscribe
  29. 29. subscribe Sequence Map Observer subscribe Publish subscribe subscribe on
  30. 30. subscribe Sequence Map Observer subscribe on on Publish subscribe on
  31. 31. ( ) subscribe Sequence Map Observer subscribe on on Publish subscribe on Subject on on
  32. 32. Question3
  33. 33. Map
  34. 34. Answer …
  35. 35. A.
  36. 36. • refCount() Hot subscribe subscribe • subscribe
  37. 37. ( ) 1 Cold Operator subscribe subscribe on on
  38. 38. ( ) 1( ) Scheduler create Operator subscribe on
  39. 39.
  40. 40. 2 create Operator Scheduler subscribe Scheduler on subscribe ( )
  41. 41. Scheduler • create Operator Scheduler
  42. 42. Scheduler • Scheduler
  43. 43. Scheduler
  44. 44. Sequence Observer subscribe
  45. 45. Sequence Observer subscribe
  46. 46. Sequence Observer subscribe on
  47. 47. • Scheduler subscribe Scheduler( ) on
  48. 48. Question4
  49. 49. .Next, .Completed on
  50. 50. Answer …
  51. 51. A. .Completed
  52. 52. • .Next • MergeSinkIter subscribe → Scheduler on observer
  53. 53. • .Completed queue dispatch .Next .Completed • …
  54. 54. Question5
  55. 55. Replay .Next 1. .Next 2. subscribe
  56. 56. Answer …
  57. 57. A. subscribe
  58. 58. • replay subscribe •
  59. 59. ( ) 2 create Operator Scheduler subscribe Scheduler on subscribe ( )
  60. 60. Observable 1. Cold Operator subscribe subscribe on on Scheduler create Operator subscribe on 2. create Operator Scheduler subscribe Scheduler on subscribe
  61. 61. observeOn, subscribeOn
  62. 62. observeOn, subscribeOn • Scheduler( ) Operator observeOn, subscribeOn
  63. 63. observeOn on Scheduler( )
  64. 64. subscribeOn subscribe Scheduler( )
  65. 65. Sequence Map Observer subscribe on observeOn .observeOn(backgroundScheduler) subscribe subscribe onon
  66. 66. Sequence Map Observer subscribe on observeOn .observeOn(backgroundScheduler) subscribe subscribe onon
  67. 67. Sequence Map Observer subscribe subscribeOn .subscribeOn(backgroundScheduler) subscribe ononon subscribe
  68. 68. Sequence Map Observer subscribe subscribeOn .subscribeOn(backgroundScheduler) subscribe ononon subscribe
  69. 69. observeOn • observeOn
  70. 70. subscribeOn • subscribeOn
  71. 71. subscribeOn • subscribeOn • create Operator Scheduler( ) Observable
  72. 72. Question6
  73. 73. Map
  74. 74. Answer …
  75. 75. A.
  76. 76. subscribe subscribe ononon subscribe Sequence Map ObserversubscribeOn Map subscribe on
  77. 77. Question7
  78. 78. Map
  79. 79. Answer …
  80. 80. A.
  81. 81. subscribe subscribesubscribe Sequence Map ObserversubscribeOn Map subscribe
  82. 82. subscribe subscribesubscribe Sequence Map ObserversubscribeOn Map subscribe Sequence MainScheduler
  83. 83. subscribe subscribesubscribe Sequence Map ObserversubscribeOn Map subscribe on on on on
  84. 84. Question8
  85. 85. Map
  86. 86. Answer …
  87. 87. A.
  88. 88. • ( )
  89. 89. ( ) observeOn on Scheduler( )
  90. 90. ( ) subscribeOn subscribe Scheduler( )
  91. 91. Driver
  92. 92. Driver • Driver RxCocoa UI Observable ( ) •
  93. 93. Driver • create Operator • Observable
  94. 94. create Operator • Driver create, just, of Operator • subscribe subscribeOn
  95. 95. create Operator
  96. 96. Observable • asDriver Observable Driver • observeOn
  97. 97. Observable
  98. 98. drive, driveNext • Driver subscribe drive driveNext • 1
  99. 99. drive, driveNext
  100. 100. Driver Operator • map Operator • • driveOnScheduler Operator
  101. 101. Question9
  102. 102. Map
  103. 103. Answer …
  104. 104. A.
  105. 105. • drive (
  106. 106. Question10
  107. 107. Map
  108. 108. Answer …
  109. 109. A.
  110. 110. subscribe Sequence Map Observer drive on on
  111. 111. Question11
  112. 112. Map Observer
  113. 113. Answer …
  114. 114. A. map observer
  115. 115. subscribe Sequence Map Observer drive onon
  116. 116. 2 NSURLSession+Rx
  117. 117. NSURLSession+Rx • rx_response rx_JSON on → UI
  118. 118. Observable 1. Cold Operator subscribe subscribe on on Scheduler create Operator subscribe on 2. create Operator Scheduler subscribe Scheduler on subscribe
  119. 119. observeOn, subscribeOn 1. subscribeOn subscribe Scheduler( ) 2. observeOn on Scheduler( )

×