-
Notifications
You must be signed in to change notification settings - Fork 303
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
context.Context support for Take? #73
Comments
For my future self - #11 tried to do the same. Some code has changed, but the comments there are valuable. I don't see why we wouldn't extend the API to allow cancellation. |
Ping! Just found this library and it has helping me doing some basic ratelimiting, so thank you for that :) Regardless, for context cancelation I am currently resorting to this (used within an httpClient impl)
|
The API extension sounds reasonable, but this is not very high in my priority list - it'll likely take weeks if not months. Happy to get more feature requests/issues - we can at least track them. But like above, I don't expect to be able to address them soon. |
I can take on this issue. However, I'm not sure how I know that the signature could be |
Also, why do we have 3 different implementations of Limiter? Do I update all of them? It appears that only one is used. |
I would recommend using https://pkg.go.dev/golang.org/x/time/rate#Limiter.Wait if it fits your requirements instead. Given recent issues with testing & complexity of the questions you listed above, we're likely to stay with the current minimal API. |
This is what I ended up using. I just forgot it existed. It's still weird to me to use a blocking API without context support. That's just me, though. |
No description provided.
The text was updated successfully, but these errors were encountered: