Closed yagikota closed 1 year ago
Are there any case when we use float rate limit?
I can only guess what Go-folks thought when they used float (https://pkg.go.dev/golang.org/x/time/rate#Limit). It is probably when you want to have requirements like events(requests) per minute/hour/day etc. limit of 11 events per minute normalized to events per second is 5.45... but yet again forcing these check per second would not make sense. Probably backwards compatibility sake or something
TBH: I do not know :)
The current document is a little bit difficult to understand the usage of
middleware.NewRateLimiterMemoryStore()
when its argument is float . So, I added supplemental explanation.Why is
RateLimiterMemoryStoreConfig.Rate
type ofrate.Limit
(float64
)? Are there any case when we use float rate limit?