You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 11, 2024. It is now read-only.
I'm not sure if I would want to put the delay amount as an argument, or maintain the existing constructors for each type. backoff.WithConstantDelay(...), backoff.WithExponentialDelay(...), backoff.WithZeroDelay(), backoff.WithNoRepeat().
vs backoff.NewConstantBackoff(...), backoff.NewExponentialBackOff(...), ...
I think this would require rewritting the backoff logic to combine support for context and max tries into the base backoff objects.
@cenkalti could you live with not breaking the API (not even on source level) but with adding the New...WithOpts siblings accepting options instead, similar to what was done with Docker's go-client API?
Right now, it's a little weird to create a backoff that has max tries, and context, and set the delay amount (zero, constant, exponential, never).
What are your thoughts on changing the interface to be something more like this:
I'm not sure if I would want to put the delay amount as an argument, or maintain the existing constructors for each type.
backoff.WithConstantDelay(...)
,backoff.WithExponentialDelay(...)
,backoff.WithZeroDelay()
,backoff.WithNoRepeat()
.vs
backoff.NewConstantBackoff(...)
,backoff.NewExponentialBackOff(...)
, ...I think this would require rewritting the backoff logic to combine support for context and max tries into the base backoff objects.
Thoughts?
Related reading: https://github.com/tmrts/go-patterns/blob/master/idiom/functional-options.md
The text was updated successfully, but these errors were encountered: