BenFradet / RiotSharp

C# wrapper for the Riot Games API
http://benfradet.github.io/RiotSharp/
MIT License
301 stars 145 forks source link

Question about Rate Limits #617

Open Tobias3107 opened 5 years ago

Tobias3107 commented 5 years ago

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?

BenFradet commented 5 years ago

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

Tobias3107 commented 5 years ago

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

BenFradet commented 5 years ago

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

kirides commented 4 years ago

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)