Trying to decide on a good ratelimiting algorithm for mastodon API requests
Basically mastodon gives you 300 requests for a 300 second time slot. I could just sleep for a second (sleep is free here, it's async) but that seems incredibly wasteful and not suitable if you do a lot of API requests in a burst.
I could also throttle like Mastodon does. Give you a bucket of "tokens", refilled every 300 seconds. But if you go over, you have to sleep until the timeslot resets... hrm.