Commit Graph

2 Commits

Author SHA1 Message Date
Lukas Herman
b7e396271d fix: rate limit update and slack unit (#685)
* add an atomic update to rate and slack

* fix: slack should be int instead of Duration

* add documentation to rateLimit and slack
2024-04-17 13:22:27 -04:00
Lukas Herman
c69c1b0580 add Clock interface and LeakyBucket (#675)
* add Clock interface and LeakyBucket

* add SimulatedClock

* removed self reference and format

* renamed t to lb

* replaced sync/atomic with uber/atomic

* add source to the license comment

* favor value over pointer receiver for SystemClock

* use atomic.Int value

* use mutex based instead

* add source

* update comments and hide mutex

* add SetRateLimitOnTheFly

* fix: source in rate_test

* skip unstable slack tests on Github
2024-04-09 11:32:35 -04:00