I'm interesting in using backon for retrying HTTP requests. I'd like to handle the retry-after HTTP header, where the server essentially can hint at which point it'd like you to retry. Which means I'd like to adjust my backoff time depending on that value.
Currently I can't figure out how I'd accomplish this as Backoff is just an iterator over Durations. The trait would need to change to have a method implementation that e.g. took in the previous backoffs and the current error, so the error could be inspected for a retry time.
Is this a feasible change? Or perhaps this is already possible and I'm not understanding the API correctly?
I'm interesting in using
backonfor retrying HTTP requests. I'd like to handle theretry-afterHTTP header, where the server essentially can hint at which point it'd like you to retry. Which means I'd like to adjust my backoff time depending on that value.Currently I can't figure out how I'd accomplish this as
Backoffis just an iterator over Durations. The trait would need to change to have a method implementation that e.g. took in the previous backoffs and the current error, so the error could be inspected for a retry time.Is this a feasible change? Or perhaps this is already possible and I'm not understanding the API correctly?