RxJava:阻塞单个与阻塞优先

时间:2019-01-16 06:44:00

标签: rx-java reactive

我永远无法理解RxJava中blockingSingleblockingFirstObservables之间的区别。任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:0)

https://github.com/ReactiveX/RxJava/wiki/Blocking-Observable-Operators

定义

IQueryable

发出first() — block until the Observable emits an item, then return the first item emitted by the Observable single( ) — if the Observable completes after emitting a single item, return that item, otherwise throw an exception 之类的声音会在发射任何物品时立即返回,并且first()等待Observable完成返回。