-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancementA general enhancement
Milestone
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
ljolin, pkgonan, jmayday, cbornet, scottjohnson and 58 morewakedeer
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancementA general enhancement