Closed
Description
Pablo Díaz-López opened SPR-14235 and commented
Currently when using cache annotations on beans it caches the Observables like other types, So it will not cache its value.
I tried to use the following pattern to handle it:
@Cacheable("items")
public Observable<Item> getItem(Long id) {
return Observable.just(id)
.map(myrepo::getById)
.cache();
}
In the happy path, as we cache the Observable
values works pretty well, but if getById
throws an exception the observable is cached with the exception which isn't how it should work.
It would be also very nice to have support to Single
.
If you give me some advice I can try to do a PR to solve this.
Affects: 4.2.5
Sub-tasks:
Referenced from: pull request #1066
1 votes, 8 watchers