Skip to content
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

feature: add client rate limit support #20

Merged
merged 3 commits into from
Mar 22, 2024
Merged

Conversation

milosgajdos
Copy link
Owner

You can specify your own rate limiter to limit the number of requests sent to the remote API.

The easiest way is probably to use the off the shelf Limiter implemented by https://pkg.go.dev/golang.org/x/time/rate#Limiter

We had to refactor the API a bit so we can wrap the http client with the provided limiter and also make room for adding retries.

You can specify your own rate limiter to limit the number of requests
sent to the remote API.

The easiest way is probably to use the off the shelf Limiter implemented
by https://pkg.go.dev/golang.org/x/time/rate#Limiter

We had to refactor the API a bit so we can wrap the http client with the
provided limiter and also make room for adding retries.

Signed-off-by: Milos Gajdos <[email protected]>
@milosgajdos milosgajdos merged commit eacb758 into main Mar 22, 2024
4 checks passed
@milosgajdos milosgajdos deleted the api-rate-limiter branch March 22, 2024 16:07
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant