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

Spread rate limiting (SpreadShaper class) #4

Closed BlossomiShymae closed 1 year ago

BlossomiShymae commented 1 year ago

This library currently only supports rate-limiting requests via burst (see Middleware.BurstShaper). It would be nice to have a functional class that is able to spread out requests while respecting the parsed rate limits.

This is the Middleware.SpreadShaper class currently:

namespace BlossomiShymae.RiotBlossom.Middleware
{
    internal class SpreadShaper : IShaper
    {
        public Task UseRequestAsync(ExecuteInfo info, HttpRequestMessage req, Action next, Action<byte[]> hit)
        {
            throw new NotImplementedException();
        }

        public Task UseResponseAsync(ExecuteInfo info, HttpResponseMessage res, Action next)
        {
            throw new NotImplementedException();
        }
    }
}

My brain is on fire from trying to come up with a solution that isn't scuffed...

3145_EM_Soraka_Calm_Inventory_100x100 blossoms

BlossomiShymae commented 1 year ago

I think (lol?) I figured it out.