php-riot-api
php-riot-api copied to clipboard
Rate limiting
This pull request implements "proper" rate limiting. Essentially, you can pass in a RateLimitHandler
class, which lets you handle being rate limited in whatever way you want (maybe log to a database and die, whatever). The default handler will simply sleep for the duration specified by the Retry-After
header, which is provided by riot when you have exceeded your limit.
@Supericy I'd love to get this merged in, I just haven't had time to really check and go through the code. Thank you so much though for contributing. If anyone else who regularly uses this can test/confirm it works, I'm happy to merge it in.
Hi,
It would be great to have production ready rate limiting, more people would use this product. Please take the time to review/implement.
@kevinohashi I got this up to date with the new URL's and api stuff, and it works for the most part. One weird thing I noticed is that it doesn't really prevent you from calling too many times, it just notices that you've called too many times, waits, then tries again. I may be wrong though, if @Supericy can explain more I think this would help a lot.