RxJava: Blocking single vs Blocking first

Viewed 6263

I could never understand the difference between blockingSingle and blockingFirst on Observables in RxJava. Any help would be greatly appreciated.

1 Answers

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.

Related