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

Update README.md to add differences with /x/time/rate#Limiter #11

Closed
nikolaydubina opened this issue Nov 12, 2022 · 2 comments · Fixed by #18
Closed

Update README.md to add differences with /x/time/rate#Limiter #11

nikolaydubina opened this issue Nov 12, 2022 · 2 comments · Fixed by #18
Assignees
Labels
Status: Completed Nothing further to be done with this issue. Awaiting to be closed. Type: Maintenance Updating phrasing or wording to make things clearer or removing ambiguity.

Comments

@nikolaydubina
Copy link

I am curious what is advantages of this pkg vs https://pkg.go.dev/golang.org/x/time/rate#Limiter

Might be good to document it visibly

@Mzack9999 Mzack9999 added the Type: Maintenance Updating phrasing or wording to make things clearer or removing ambiguity. label Nov 13, 2022
@Mzack9999
Copy link
Member

Mzack9999 commented Nov 13, 2022

@nikolaydubina Thanks for opening this issue.
The original library implements the classical "token bucket" algorithm, allowing a burst of tokens and a refill that happens at a specified ratio by one unit at a time.
This implementation, instead, is a variant that allows a burst of tokens just like "the token bucket" algorithm, but the refill happens entirely at the defined ratio.
This allows scanners to respect maximum defined rate limits, pause until the allowed interval hits, and then process again at maximum speed. The original library slowed down requests according to the refill ratio.

Good point about improving the documentation. we will do the following:

  • Update README.md with the above description in a new section Differences with https://pkg.go.dev/golang.org/x/time/rate#Limiter

@nikolaydubina
Copy link
Author

nikolaydubina commented Nov 14, 2022 via email

@ehsandeep ehsandeep changed the title Difference from golang.org/x/time/rate#Limiter Update README.md to add differences with /x/time/rate#Limiter Nov 17, 2022
@tarunKoyalwar tarunKoyalwar self-assigned this Dec 13, 2022
@tarunKoyalwar tarunKoyalwar linked a pull request Dec 14, 2022 that will close this issue
@Mzack9999 Mzack9999 added the Status: Completed Nothing further to be done with this issue. Awaiting to be closed. label Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Completed Nothing further to be done with this issue. Awaiting to be closed. Type: Maintenance Updating phrasing or wording to make things clearer or removing ambiguity.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants