RiotSharp icon indicating copy to clipboard operation
RiotSharp copied to clipboard

Question about Rate Limits

Open Tobias3107 opened this issue 5 years ago • 4 comments

Hey, I have the Problem that i want do MultiThreading but if i do more then 5 Request it will send me a "Rate limit exceeded". So i have a Question will tjhe Rate Limits checked by RiotSharp. So that i can send so many requestion and the RiotSharp will wait for the RateLimits?

Tobias3107 avatar Apr 16 '19 10:04 Tobias3107

Yes riotsharp checks for rate limits and throttle requests, however I don't know if that still is the case when leveraging multithreading.

BenFradet avatar Apr 16 '19 10:04 BenFradet

It Should then i thing. Because it is the Same instance or iam false?

Tobias3107 avatar Apr 16 '19 10:04 Tobias3107

if you share the same instance across your threads yes but I don't know how thread safe our code is.

BenFradet avatar Apr 16 '19 10:04 BenFradet

i had to use time-based rate limiting lately i can totally recommend http://david-desmaisons.github.io/RateLimiter/ (currently at v2.1.0) for time based constraints. You can easily create time based, thread-safe limiters that work well with async-code (you can await a limiter)

kirides avatar Oct 18 '19 16:10 kirides