Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/117/rate

rate limit the execution of a function in Go
https://github.com/117/rate

go golang rate-limit rate-limiter rate-limiting

Last synced: 21 days ago
JSON representation

rate limit the execution of a function in Go

Awesome Lists containing this project

README

        

# rate

```go
func main() {
limiter := rate.NewLimiter(3, time.Second)

for {
limiter.SleepIfRateExceeded(func() {
fmt.Println("only printed 3 times per second")
})
}
}
```