-
Notifications
You must be signed in to change notification settings - Fork 753
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
New retry api for supporting timeouts before retrying again #363
base: master
Are you sure you want to change the base?
Conversation
Capturing some high-level thinking on this - we'll need to patch this in to make some further edits before merging:
|
This is a subset of google#363 which ensures a ScheduledExecutorService is available, but does not yet define a new RetryPolicy interface. This gives us the flexibility to introduce timer-based operations later without needing to change the ExecutorFactory interface (which is now an abstract class to allow for future additions, should any others be necessary).
This is a subset of google#363 which ensures a ScheduledExecutorService is available, but does not yet define a new RetryPolicy interface. This gives us the flexibility to introduce timer-based operations later without needing to change the ExecutorFactory interface (which is now an abstract class to allow for future additions, should any others be necessary).
#367 splits out the subset of this involving providing a ScheduledExecutorService and handles the first two points above in making ScheduledExecutorService required and sharing more of the ThreadFactory with the other executors. The broader RetryPolicy changes are still a good idea, but we can defer them until the rest of the Async stack is fleshed out. |
This is a subset of google#363 which ensures a ScheduledExecutorService is available, but does not yet define a new RetryPolicy interface. This gives us the flexibility to introduce timer-based operations later without needing to change the ExecutorFactory interface (which is now an abstract class to allow for future additions, should any others be necessary).
…#367) This is a subset of #363 which ensures a ScheduledExecutorService is available, but does not yet define a new RetryPolicy interface. This gives us the flexibility to introduce timer-based operations later without needing to change the ExecutorFactory interface (which is now an abstract class to allow for future additions, should any others be necessary).
This is code that implements a new api for a retry policy that supports a timeout before retrying. Firstly, I created a new interface that gets the amount of time to wait for that retry policy. To actually schedule it, I pass a ScheduledThreadPoolExecutor into the network, then schedule the request on that to be done after the appropriate amount of time.
Some things to note: