mosquito-cr / mosquito

A background task runner for crystal applications supporting periodic (CRON) and manually queued jobs
MIT License
227 stars 24 forks source link

Leaky bucket #102

Open robacarp opened 2 years ago

robacarp commented 2 years ago

re #100 re #101

This implements a weak leaky bucket rate limiter. The most significant limitation is that implementing the rate limit on the job side means the queue will shuffle around jobs when the run speed is rate limited -- jobs are popped off the queue and then re-enqueued via the scheduler. This is probably better than nothing for those that need it.