- Use Bucket#connditional_fillup inside Throttle and throttle only when the capacity would be exceeded, as opposed to throttling when capacity has already been exceeded. This allows for finer-grained throttles such as "at most once in", where filling "exactly to capacity" is a requirement. It also provides for more accurate and easier to understand throttling in general.
- Make sure Bucket#able_to_accept? allows the bucket to be filled to capacity, not only to below capacity
- Improve YARD documentation
- Allow "conditional fillup" - only add tokens to the leaky bucket if the bucket has enough space.
- Fix
over_time
leading to incorrectleak_rate
. The divider/divisor were swapped, leading to the inverse leak rate getting computed.
- Allow
over_time
in addition toleak_rate
, which is a more intuitive parameter to tweak - Set default
block_for
to the time it takes the bucket to leak out completely instead of 30 seconds
- Add support for SQLite
- Use comparisons in SQL to determine whether the leaky bucket did overflow
- Change the way Structs are defined to appease Tapioca/Sorbet
- Initial release