Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Limiter ¶
type Limiter interface { // Take should block to make sure that the RPS is met before returning true. // If the passed in channel is closed, Take should unblock and return false. Take(cancel <-chan struct{}) bool }
Limiter is used to rate limit some process, possibly across goroutines. The process is expected to call Take() before every iteration, which may block to throttle the process.
func NewInfinite ¶
func NewInfinite() Limiter
NewInfinite returns a RateLimiter that is not limited.
Click to show internal directories.
Click to hide internal directories.