I have a REST API that calling mongodb using the reactive scala driver which based on RxScala.
In my API controllers or services layers, I need to use caching to avoid calls to mongodb using hazelcast (or any other caching tools)
All my services are async and returns only observable, any idea how I can implement the caching with observable?
Cache in .doOnNext(), retrieve as .myFromCacheObservable().switchIfEmpty(serviceCallOrDbOrWhatever.doOnNext(mySaveToCache))