Get the latest tech news
Modelling API rate limits as diophantine inequalities
viveknathani - blog
But before we dive into the scheduling logic, let’s take a short detour into something older and surprisingly relevant: Diophantine equations. This way, we keep track of the range of requests that fall within any given window as we move through the sorted list. We shift the window forward as needed, reusing previous work and avoiding redundant scans.
Or read this on Hacker News