This repository has been archived by the owner on Nov 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 185
Give reason for Stop #97
Comments
I'm sorry, I can't think of a solution without changing the API. |
We just reverted NextBackOff function so that it does not "predict" if there are no more retries and returns Stop only after ctx.Err is set to DeadlineExceeded. I agree having NextBackoffError() might be a good option. |
@praran26 Sure, but I don't think that's a good long-term solution. It's a good feature to have. How do you think we can square NextBackOffError with the interface? |
This was referenced Jun 25, 2021
Just an idea: Backoff can optionally implement |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hey,
I just pulled a newer version of backoff into some internal things, importing among others this patch: 62661b4
Problem is that now it's impossible for the user to tell if we stopped because of a DeadlineExceeded versus other reasons. Got any ideas how to deal with that? I don't like changing the API, because most people probably compare against
backoff.Stop
, but I'm not sure what else to do.Perhaps an alternative
NextBackOff
method that can returnStop
orDeadlineStop
?Or
NextBackOffError() (time.Duration, error)
that can return a context.DeadlineExceeded?Any ideas?
Thanks
The text was updated successfully, but these errors were encountered: