-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
apcu adapter #25
apcu adapter #25
Conversation
I think this PR is ready |
You should fix I'll have more time to review PRs during the weekend. |
I didn't previously see the conflict. As mentioned above if this gets merged I can PR the memcached adapter and I'll be done with the original contribution |
Please correct me if I'm wrong, but this basically doubles memory usage just to satisfy the constraints of the SilentRateLimiter interface, even if the user does not want to use it. Wouldn't it be better if |
@Rainrider you are right, the amount of memory needed for this implementation, or any other in which remaining ttl is not returned by the provider, is more than doubled There is another possible implementation in which you save both counter and timestamp in a single key: "counter::timestamp", but you loose atomic operations such as About not supporting remaining time to reset on an HTTP header I wouldn't consider it. If you have a peak to API rate limiting headers in the wild you'll see it is always there in a way or another (https://stackoverflow.com/questions/16022624/examples-of-http-api-rate-limiting-http-response-headers) there is even a IETF proposal for this headers (https://tools.ietf.org/id/draft-polli-ratelimit-headers-00.html), strange enough they are not standard |
I think @Rainrider brought up a good point. Why does default rate limiting implementation needs to be coupled with the logic around Try to focus on optimizing |
Build is stuck on this one for 2 days... 🤔 |
It's not stuck, if you take a look you'll see it passed, but github does not reflect it |
memcached adapter will have to wait till this gets merged