udoprog / leaky-bucket

A token-based rate limiter based on the leaky bucket algorithm.
Apache License 2.0
93 stars 10 forks source link

Allow cloning on the rate limiter #31

Closed niks3089 closed 2 months ago

niks3089 commented 6 months ago

We would need this support when we want to have multiple instances of rate limiter for different configurations.

udoprog commented 2 months ago

It's probably better in terms of design to keep waiting parameters somewhere else in your own application and just construct a RateLimiter wherever you are constructing them using those parameters.

But if you want Builder to be clone, feel free to open a PR with the derive.