energizer91 / smart-request-balancer

Smart request queue with fine tuning of rate and limit of requests
MIT License
97 stars 8 forks source link

Providing multiple limits for same rule #10

Open rahul9269 opened 5 years ago

rahul9269 commented 5 years ago

Hey, Is there a way to provide multiple limits for the same rule. I have a requirment when my application needs to call an api and the api rules are as follows.

5 request in 1 second 75 requests in 1 minutes 750 requests in 1 hour.

Can this be achieved as of today or should this be a feature request.

regevbr commented 5 years ago

This will be a really big feature request, as it will require a whole different way of handling the limits using sliding windows mechanisms. Maybe it will even require a new library all together. @energizer91 thoughts?

energizer91 commented 4 years ago

Hi! Well, yes, unfortunately, there's a different way of balancing the queue. The only way of doing that with that package is to set hour rule.