New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[enhancement] Add Functional Options for Configuring ExponentialBackOff #136
Comments
KhanSufiyanMirza
pushed a commit
to KhanSufiyanMirza/backoff
that referenced
this issue
Sep 12, 2023
cenkalti
pushed a commit
that referenced
this issue
Sep 15, 2023
@cenkalti could you create a tag for this please? |
@cenkalti |
Tagged as v4.3.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description:
As part of enhancing the usability of the
backoff
library, I propose adding functional options for configuring theExponentialBackOff
struct. Functional options provide a more flexible and extensible way to set various parameters for theExponentialBackOff
.Feature Details:
InitialInterval
,RandomizationFactor
,Multiplier
,MaxInterval
,MaxElapsedTime
,StopDuration
, andClock
.NewExponentialBackOff
to accept these functional options.Expected Behavior:
Developers will be able to easily configure the
ExponentialBackOff
struct with the desired parameters using functional options. This will make the library more user-friendly and customizable.backOff := NewExponentialBackOff( WithInitialInterval(1*time.Second), WithMultiplier(2.0), WithMaxInterval(10*time.Second), WithMaxElapsedTime(30*time.Second), WithRetryStopDuration(0), WithClockProvider(SystemClock), )
Motivation:
This feature will enhance the library by allowing users to configure the
ExponentialBackOff
struct in a more intuitive and extensible way. It aligns with best practices for creating flexible APIs.Additional Information:
Please let me know your thoughts and whether this feature aligns with the project's goals.
The text was updated successfully, but these errors were encountered: