-
Notifications
You must be signed in to change notification settings - Fork 518
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
An idea for async retry #176
base: main
Are you sure you want to change the base?
Conversation
If a RetryCallback returns an async type it can be wrapped by the RetryTemplate. The template needs to know about all the callback return types that need wrapping, via its RetryResultProcessors property (not set by default). See AsyncRetryTemplateTests for examples of how to do this.
I rebased your work onto master. See PR: ashamukov#1 (or alternatively reset your own branch to https://github.com/dsyer/spring-retry/tree/ashamukov-async-retry). |
True, but it's a really common pattern. The way we normally solve it in Spring projects is to provide a wrapper for the executor that has to be supplied by the user for the background state to be propagated. I expect we can do that - if the user provides the right wrapper they can use |
49f66e0
to
bf8dadb
Compare
@dsyer Hello Dave! Thanks for the rebase.
Here is an example of solution: ashamukov#2 What do you think? |
I give that solution 👍 |
Thanks, Artem!) |
Well, doesn't look like it is going to be an easy task to extract some common abstraction and we may end up with generics hell. |
This is an attempt ;) ashamukov/spring-security#1 |
You know, looks cool! Let's raise an issue in https://github.com/spring-projects/spring-framework/issues and page @rwinch for determining what we would like to do with Spring Security after that common abstraction. I believe there might be some improvements or changes in your solution, but at least my colleagues will know our position about such a propagation abstraction from one thread to another! 😄 |
Thanks, Artem!
The issue: spring-projects/spring-framework#23876 |
I rebased and did some tidying up: https://github.com/dsyer/spring-retry/tree/ashamukov-async-retry. We can start from there if anyone is interested in this. It works for |
Hello! Here is a draft for the async retry feature with rescheduling.
The goal for now is to discuss: is it worth to implement it this way.
(javadoc and formatting are expected to be later)
The general idea is described in the README.dm diff, and also is outlined here:
Checklist:
java.util.concurrent.Future
support are discussed and implementedCopy pasted from the issue:
Can be done in separate PRs:
#154