Refactor RequestRetrier into backoff and URI middleware #275
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.
Before this PR
RequestRetrier
was responsible for both selecting which URI to try next as well as implementing backoff behavior. This change breaks up that functionality into two separate middlewares:Motivation behind making this change is to enable further work like:
URIScoringMiddleware
API in the future, this can be used instead of the default URI middleware instead of in additionRequest
properties in middleware e.g. Add rendezvous hash URI scorer #268Retrier
orMiddleware
to add custom retry or URI selection logic to CGRAfter this PR
==COMMIT_MSG==
Refactor RequestRetrier functionality into two separate middlewares. Backoff middleware implements retry backoff for URIs that have already been attempted and URI Middleware
==COMMIT_MSG==
Possible downsides?
No change in behavior or public API in this change so no apparent downsides.
This change is