I could never understand the difference between blockingSingle and blockingFirst on Observables in RxJava. Any help would be greatly appreciated.
I could never understand the difference between blockingSingle and blockingFirst on Observables in RxJava. Any help would be greatly appreciated.
definitions from https://github.com/ReactiveX/RxJava/wiki/Blocking-Observable-Operators
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
sounds like first() immediately returns upon emitting any item, and single() waits for the Observable to complete to return.