resty
resty copied to clipboard
Add rate limiter to client
Add a simple per client rate limiting based on golang.org/x/time/rate
.
@jeevatkm Could you please check this? it would be great to have integrated rate limiter
So it looks ok, what needs to be done to finish this? I can help.
@dbriemann I'm sorry for the delayed attention on the PR. Your feature proposal make sense, do you mind preparing the PR for review with tests & validation build success?
I am very busy these days but I can have a look in the near future what exactly there is left to do.
I am very busy these days but I can have a look in the near future what exactly there is left to do.
@dbriemann Thanks for getting back.
OK I found some time to update this today. It is a very simple rate limiter which returns an ErrRateLimitExceeded
on an execute
that exceeds the limit. There are no automatic retries. The user has to handle these accordingly.
Not sure how good the API is. Just give it a review.
@dbriemann My apologies for the late. I have thought about it. Adding an interface contract into Resty will provide options for the users to any rate limiter or their version instead of integrating the library golang.org/x/time/rate
.
In this PR, you have used the Allow()
method from the available library options; I think we can start with this one method as a contract.
Are you interested in taking it up? Please let me know.
has been merged in #715, can be closed
Of-course @SVilgelm