Migration from node-rate-limiter package: Using RateLimiterQueue with BurstyRateLimiter?
See original GitHub issueHi
In the documentation for BurstyRateLimiter it claims All limiters from this package can be used for BurstyRateLimiter creation
. However, if you try to construct one with RateLimiterQueue it fails because it doesn’t adhere to the necessary interface.
I am trying to migrate from TokenBucket from the https://github.com/jhurliman/node-rate-limiter package. This behaves in such a way that you can burst but also has an outstanding request queue so you can await
on the calls for the bucket to refill.
I want to take the FIFO logic & promise awaits from RateLimiterQueue but the burst of BurstyRateLimiter.
Without writing a wrapper this currently is not achievable.
KR
Issue Analytics
- State:
- Created a year ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
BurstyRateLimiter · animir/node-rate-limiter-flexible Wiki - GitHub
The idea is to rate limit traffic by two limiters: limiter and burst limiter. If there are no points in the first, try...
Read more >rate-limiter-flexible - npm
Node.js rate limiter by key and protection from DDoS and Brute-Force attacks in process Memory, Redis, MongoDb, Memcached, MySQL, ...
Read more >rate-limiter-flexible - npm Package Health Analysis - Snyk
Node.js rate limiter by key and protection from DDoS and Brute-Force attacks in process Memory, Redis, MongoDb, Memcached, MySQL, PostgreSQL, Cluster or PM ......
Read more >Overall example · animir/node-rate-limiter-flexible Wiki
Count and limit requests by key with atomic increments in single process or distributed environment. - Overall example · animir/node-rate-limiter-flexible Wiki.
Read more >The node-rate-limiter-flexible from animir - GithubHelp
Whenever your application grows, it is ready. Prepare your limiters in minutes. Friendly. No matter which node package you prefer: redis or ioredis ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I understand you need it to be re-filled in small chunks. You could try to create a limiter with long duration like 14 days and re-fill 1 point every second with
setTimeout
using reward function, but not sure if it is worth it.@dt-atkinson I think, it can be. There is an example in docs here