We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The concept:
sem := limiter.ForUser(request.Context()) release, err := sem.Acquire(semaphore.WithTimeout(config.SLA)) if err != nil { http.Error(rw, "operation timeout", http.StatusGatewayTimeout) return } deadline := semaphore.WithDeadline(time.Now().Add(config.LimitRange)) go func() { release() release, err = sem.Acquire(deadline) if err != nil { return } <-deadline release() }() // handle user request
The text was updated successfully, but these errors were encountered:
issue #106: work in progress
64731a0
1ef11c4
fix issue #106: add rate limit example
270a6b9
kamilsk
No branches or pull requests
The concept:
The text was updated successfully, but these errors were encountered: