Which time windows does this limiter use?
Joldnine opened this issue · comments
Joldnine commented
Is it sliding window or fixed window? How can it be configured for the window?
Thomas LE ROUX commented
Hello,
It's a fixed window. You can configure it by using this way:
rate := limiter.Rate{
Period: 1 * time.Minute,
Limit: 100,
}
Or even this way:
rate, err := limiter.NewRateFromFormatted("100-M")
You'll have a window of one minute that allows 100 requests.
If you have further question, don't hesitate 🙂