1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2025-01-09 13:37:02 +00:00
arikawa/wsutil/throttler.go

16 lines
252 B
Go

package wsutil
import (
"time"
"golang.org/x/time/rate"
)
func NewSendLimiter() *rate.Limiter {
return rate.NewLimiter(rate.Every(time.Minute), 120)
}
func NewDialLimiter() *rate.Limiter {
return rate.NewLimiter(rate.Every(5*time.Second), 1)
}