I am going through a book which tells how to intorduce RxJava in legacy blocking code.
It basically does this:
Observalbe.defer(() -> {return Observable.from(someBlockingMethodTofetchDBRecords(....))});
It says that defer would introduce laziness in the program. But isn't Observable by default lazy. Observable.from should return an observable and it wont do anything until we subscribe to it. So why do we need defer here?
question from:https://stackoverflow.com/questions/65626693/laziness-with-rxjava-defer