Currently, the client supports retry with WithRetry(true), but retry behavior (attempts, delays, backoff strategy) is not configurable.
Add options to configure retry parameters:
- Maximum retry attempts
- Initial retry delay
- Backoff strategy (exponential, linear, fixed)
- Maximum retry delay
Proposed API
client := spotify.New(auth.Client(ctx, token),
spotify.WithRetry(true),
spotify.WithMaxRetries(3),
spotify.WithInitialDelay(time.Second),
spotify.WithMaxDelay(30*time.Second),
spotify.WithBackoffStrategy(spotify.ExponentialBackoff),
)
// OR
retryCfg := &spotify.RetryConfig{
MaxRetries: 3,
InitialDelay: time.Second,
MaxDelay: 30 * time.Second,
Backoff: spotify.ExponentialBackoff,
}
client := spotify.New(auth.Client(ctx, token),
spotify.WithRetry(true),
spotify.WithRetryConfig(retryCfg),
)
Applications with different reliability requirements need control over retry behaviour to balance between request success rate and response latency.
I would be happy to contribute and work on this feature.
Currently, the client supports retry with
WithRetry(true), but retry behavior (attempts, delays, backoff strategy) is not configurable.Add options to configure retry parameters:
Proposed API
Applications with different reliability requirements need control over retry behaviour to balance between request success rate and response latency.
I would be happy to contribute and work on this feature.