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

Rate limiter and leaky bucket #4

Merged
merged 4 commits into from
Jun 3, 2019
Merged

Conversation

un000
Copy link
Owner

@un000 un000 commented Jun 3, 2019

No description provided.

}

func (rl *ChannelBasedRateLimiter) Allow() bool {
select {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be

_, ok := <-rl.t.C
return ok

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No one closes it.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except strange users which Close manually()

@un000 un000 force-pushed the rate-limiter-and-leaky-bucket branch from ac4a4d7 to 6897ad3 Compare June 3, 2019 20:15
@un000 un000 force-pushed the rate-limiter-and-leaky-bucket branch from 6897ad3 to 96fca67 Compare June 3, 2019 20:32
@un000 un000 force-pushed the rate-limiter-and-leaky-bucket branch from ee33930 to 236a4d2 Compare June 3, 2019 22:48
@un000 un000 merged commit 34ae62e into master Jun 3, 2019
@un000 un000 deleted the rate-limiter-and-leaky-bucket branch June 3, 2019 22:52
un000 added a commit that referenced this pull request Jun 3, 2019
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.

None yet

2 participants