Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support caching annotations for CompletableFuture return values [SPR-12967] #17559

Closed
spring-projects-issues opened this issue Apr 30, 2015 · 4 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Lukas Krecan opened SPR-12967 and commented

It would be nice to support caching of ListenableFuture (CompletableFuture) results. Imagine that your method returns ListenableFuture and you want to cache the result (not the future itself). If I am not mistaken it is not currently supported.

I may send you a pull request, but I'd like to hear if it makes sense. It may be a bit confusing since the cache would be filled/evicted not upon the method exit but upon the future completion.


Affects: 4.1.6

@spring-projects-issues
Copy link
Collaborator Author

Lukas Krecan commented

Hint of the solution lukas-krecan@48329ff

@spring-projects-issues
Copy link
Collaborator Author

Stéphane Nicoll commented

We don't foresee such feature in the 4.x line as it sounds it's part of a more general reactive effort.

Looking at your proposal it has significant impacts on the boundaries and the semantics of the caching aspect (basically what happens when we exit the method vs. what happens when the value to cache is actually made available). JSR-107 has also some plans to add an asynchronous API (see this issue) so this request may benefit from that stuff.

@spring-projects-issues spring-projects-issues added status: waiting-for-triage An issue we've not yet triaged or decided on type: enhancement A general enhancement in: core Issues in core modules (aop, beans, core, context, expression) and removed type: enhancement A general enhancement labels Jan 11, 2019
@rstoyanchev rstoyanchev added status: bulk-closed An outdated, unresolved issue that's closed in bulk as part of a cleaning process and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jan 11, 2019
@spring-projects-issues
Copy link
Collaborator Author

Bulk closing outdated, unresolved issues. Please, reopen if still relevant.

@jhoeller jhoeller added type: enhancement A general enhancement and removed status: bulk-closed An outdated, unresolved issue that's closed in bulk as part of a cleaning process labels Jul 21, 2023
@jhoeller jhoeller self-assigned this Jul 21, 2023
@jhoeller jhoeller added this to the 6.1.0-M4 milestone Jul 21, 2023
@jhoeller
Copy link
Contributor

As explained in #17920 (specifically #17920 (comment)), we have a CompletableFuture based arrangement with the Caffeine AsyncCache as a primary provider now. That effort comes with equivalent reactive support but can be used standalone with just CompletableFuture as well, effectively addressing this ticket here too.

@jhoeller jhoeller reopened this Jul 21, 2023
@jhoeller jhoeller changed the title Support for Future responses in caching annotations [SPR-12967] Support caching annotations for CompletableFuture return values [SPR-12967] Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants