This lesson describes the similarities and differences between the RxJava
The operators are very similar and both can be used to solve the same type of problem: converting an expensive method call into an RxJava Observable.
This lesson describes the benefits of each and offers a recommendation on which you should use.
Summary of Content:
- What version of RxJava is required for each operator
- Advantages of using fromCallable over defer
- How fromCallable can result in writing less code
- Why fromCallable provides better error handling
- An example problem showing solutions using both fromCallable and defer
- How compact the code can become when using Retrolambda
Other Relevant Links:
Thanks for letting me know, Rodrigo. I'm not sure why that doesn't work (I swear it used to!) but this one should definitely work: https://github.com/CDRussell/CasterRxJava/tree/defer_vs_fromCallable
I'll update the link above. Thanks!