-
Notifications
You must be signed in to change notification settings - Fork 38.5k
SPR-14235 - Reactive types support for @Cacheable methods #1066
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
Conversation
Interesting, thanks! ping @sdeleuze |
Interesting use case indeed, especially with Spring Framework 5 in mind. As noticed in the JIRA issue, the first need here is to make Spring About the implementation provided in this PR, if I understand correctly the data emitted by an I have in mind some good use cases where supporting async single return values like Any thoughts? |
With The Yes, the implementation uses an About infinite streams, I don't think spring cache should support it, as if we store the values it will full the cache, and if we store the logic between events it will force the classes involved to be With current implementation it should be quite straightforward to implement it for other async wrappers, but maybe it need some change to fit in all cases or to be more understandable. :) |
Hi @padilo The problem with those features is that not all concepts can be translated in the reactive world. Which means that we have to carefully review the big picture before committing to get Alongside the questions asked by @sdeleuze we may wonder how keys should be generated if In all cases, I think this belongs to a broader issue we have to tackle in Spring 5.0. |
I understand and I'm completely agree. This kind of feature should fit very well with current needs in Spring 5.0 and having in mind the whole picture, this is not an easy task and should be take with very care. Thank you very much for your feedback :) |
Is it in your roadmap to merge this anytime soon? |
There is a reference to a Jira issue. We'll work on that as part of Spring 5 |
@sdeleuze that does not make any sense to me. IMO, the only thing we should really support is An infinite stream means you're trying to cache a collection of infinite size. Something is wrong elsewhere if you're trying to do that. I can see some issue with the SpEL support (especially the one that has to run upfront). But if we limit ourselves to @padilo would you be willing to rebase your PR and rework the code to use |
Sure I'll try to address this today. Still WIP to move to |
@padilo Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
@padilo Thank you for signing the Contributor License Agreement! |
Still pending some formatting errors, import order and so on (I'll correct this on another commit, probably tomorrow).
Currently, if I haven't misunderstood you, we won't support @snicoll I'm not sure if this is what you mean by use Another point I found is that there is a difference with
In the conversion using I'll work on having the formatting 100% ok, while wait for feedback. |
Wow that's awesome! I can't reply you right the way regarding My intent was to look how the reactive controller ( |
3bdec66
to
1b47465
Compare
Rebased on top of master and fixed import order, should be ok now. @snicoll Thank you ;). I'll take a look to the |
Not sure if we can use If done this way I think it would work transparently and any new conversion that the I'm not 100% sure, but it sounds good in my head :) |
That's sort of what I have in mind. Let me go back on this one once I am done with other things and we can resume the discussion at that point. Thanks a lot for all your work! |
Ok, thank you ;)
|
Rebased on top of master, improved There isn't support to |
@padilo thank you so much for the PR: it really helped to look at something concrete with regards to the feedback we get on Spring 5. At this point, I am afraid that the implementation does not match where we're heading. If we add support for this, we need to be reactive all the way so we need a It looks like we're targeting the support of We're still investigating if actual implementations of this I am now trying to build a test suite of what the behaviour should be and take it from there. I'll report on the Jira issue you've created. |
Thanks @snicoll for all your time and your feedback 😉 It was fun to implement it and to look how to fit it in Spring Cache. And also I learn something about Reactor. 👍 |
Support for cache Observable return values.
Not ready to be merge as it doesn't follow the Code style, but I need a bit of feedback :)
Tests are included
https://jira.spring.io/browse/SPR-14235