vutran1710 / PyrateLimiter

⚔️Python Rate-Limiter using Leaky-Bucket Algorithm Family
https://pyratelimiter.readthedocs.io
MIT License
336 stars 36 forks source link

Changing rate limit after limiter was configured #112

Closed estahn closed 1 year ago

estahn commented 1 year ago

I would like to change the limiter configuration after the decoration was applied for these reasons:

  1. Testing - allow to set a lower threshold for testing in order to preserve time/CPU cycles
  2. Reconfigure from HTTP request headers:

Some API's return their remaining volume (e.g. X-RateLimit-Remaining) via headers, and I would like to set the limiter values to these if available.

vutran1710 commented 1 year ago

@estahn i agree this should be implemented, yet im planning to release the next major version so im not going to invest more time on the current version -

of course if you can lend a hand making a PR, then we can update it immediately

estahn commented 1 year ago

@vutran1710 I was able to resolve my issue differently hence I'm not in urgent need. If I find some time I contribute.

vutran1710 commented 1 year ago

closing.