blockingSingle我永远无法理解 RxJava 中和blockingFirston之间的区别Observables。任何帮助将不胜感激。
来自https://github.com/ReactiveX/RxJava/wiki/Blocking-Observable-Operators的定义
\n\nfirst() \xe2\x80\x94 block until the Observable emits an item, then return the first item \nemitted by the Observable\n\nsingle(\xe2\x80\x89) \xe2\x80\x94 if the Observable completes after emitting a single item, return \nthat item, otherwise throw an exception\nRun Code Online (Sandbox Code Playgroud)\n\n听起来像是first()在发出任何项目后立即返回,并single()等待 Observable 完成返回。
| 归档时间: |
|
| 查看次数: |
8263 次 |
| 最近记录: |