BlossomiShymae / RiotBlossom

An asynchronous, extensible, and magical Riot Games API wrapper library for C#. ☆*:.。.o(≧▽≦)o.。.:*☆
https://blossomishymae.github.io/RiotBlossom/
MIT License
12 stars 2 forks source link

Improve spread rate limiting (SpreadShaper.cs) #6

Open BlossomiShymae opened 1 year ago

BlossomiShymae commented 1 year ago

I think the current spread limiting strategy for AlgorithmicLimiter can be improved upon. With how it works currently, it is set to be overly safe for the delay coefficient (3 * Math.Pow(progress, 2)). Unfortunately, a small percentage of requests (~0-5%) for a given limit is left unused. u.u

It works for now but it can probably be changed for the better. Setting the delay coefficient any lower will just trigger the WarningLimiterException (for smaller or larger rate limits I don't remember...), not what we wantsies.

See lines of code.

BlossomiShymae commented 1 year ago

I think I should just make it queue-based and have the web request be sent based on available time before the limit bucket resets.

3680_EM_BATTLEPASS_GWENPEACE_Inventory_100x100 blossoms