New retry api for supporting timeouts before retrying again#363
Open
sphill99 wants to merge 3 commits intogoogle:masterfrom
Open
New retry api for supporting timeouts before retrying again#363sphill99 wants to merge 3 commits intogoogle:masterfrom
sphill99 wants to merge 3 commits intogoogle:masterfrom
Conversation
jbiral
approved these changes
Aug 21, 2020
Collaborator
|
Capturing some high-level thinking on this - we'll need to patch this in to make some further edits before merging:
|
jpd236
added a commit
to jpd236/volley
that referenced
this pull request
Sep 26, 2020
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).
jpd236
added a commit
to jpd236/volley
that referenced
this pull request
Sep 26, 2020
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).
Collaborator
|
#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. |
jpd236
added a commit
to jpd236/volley
that referenced
this pull request
Sep 28, 2020
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).
jpd236
added a commit
that referenced
this pull request
Sep 29, 2020
…#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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: