We would like to add support for v3 Web API rate limits, as described here.
_How would you like this to be implemented?_ Or please give a thumbs up to express your interest in us implementing to move this task up our queue.
PRs are always welcome as well :)
We can throw RateLimitException when status_code = 429but it's not really helpful because we can handle it manually by https://github.com/sendgrid/sendgrid-python/blob/troubleshooting/TROUBLESHOOTING.md#error-messages
Hi there, I think it would be helpful to auto rate limit somehow. The way I'm doing it on my end is using the pause library to do a [pause.until(datetime)] based on the headers sendgrid returns.
However, it might be nice if the client let me call it without worrying about rate limiting, and then it works in an async fashion to properly send those requests within the rate limits. Trigger a callback when it's done.
That, or sleep under the hood, but that's a bit prescriptive
@mbernier @thinkingserious Can I take up this issue?!
I'm jotting down an algorithm on how to rate limit efficiently and will put down the proposal here. Thereafter we can take it forward with the feedback.
_Feels good to get back to contribute to Sendgrid :)_
Thanks
It's all your @waseem18! Thank you! Glad to have you back :)
Since there has been no activity on this issue since March 1, 2020, we are closing this issue. Please feel free to reopen or create a new issue if you still require assistance. Thank you!
Most helpful comment
Hi there, I think it would be helpful to auto rate limit somehow. The way I'm doing it on my end is using the pause library to do a [pause.until(datetime)] based on the headers sendgrid returns.
However, it might be nice if the client let me call it without worrying about rate limiting, and then it works in an async fashion to properly send those requests within the rate limits. Trigger a callback when it's done.
That, or sleep under the hood, but that's a bit prescriptive