nandlabs / golly

golly is a open source library for go
https://golly.nandlabs.io
MIT License
19 stars 2 forks source link

[Rate Limit Support for turbo] #49

Open neo7337 opened 2 months ago

neo7337 commented 2 months ago

Is your feature request related to a problem? Please describe. Add a rate limit capability you our turbo config.

Describe the solution you'd like Create a rate limit package for turbo and provide its implementation.

nandagopalan commented 2 months ago

This is much needed feature.

I am thinking of having this as a separate module and use that in Turbo. We may want to have this for other transport implementation as well including client implementations as this will be useful for clients who want to be within the limits.

Here are the high level features we may want to implement for a specific client

  1. Simple rate limiting per unit time
  2. Burst Limit - We may want to allow a burst limit per specific period.
  3. Custom limits over different periods
  4. Overall limit per period
  5. Combination of above

The rate limit information may have to be stored in a cache to support multiple instances serving the requests. Raised an issue for caching #51 in order to implement this.