-
Notifications
You must be signed in to change notification settings - Fork 56
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem? Please describe.
Currently when using a List function it provides no way to mitigate rate limit errors.
Describe the solution you'd like
Ideally a way to rate limit requests. It could be achieved by passing in a ratelimiter interface to the function either as a new function parameter, in params, or as an option.
type RateLimiter interface{
Take()
}
Given the current interface I would claim creating a new ratelimiter option is the cleanest/easiest way.
Describe alternatives you've considered
Currently the only way to incorporate a rate limiter is before the initial List function and then before the iter.Next() function is called. But in a concurrent application this is insufficient.
ratelimiter.Take()
iter := c.ListAggs(context.TODO(), params, opts...)
for iter.Next() {
log.Print(iter.Item()) // do something with the current value
ratelimiter.Take()
}
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request