Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RateLimiter ¶
TODO consider making this also perform rate limiting with priority, so more important events take priority; also consider using or making its ICD like golang.org/x/time/rate
func New ¶
func New(requestsPerSecond float64) *RateLimiter
func (*RateLimiter) TakeMore ¶
func (t *RateLimiter) TakeMore(ctx context.Context, rateBlocksBefore, rateBlocksAfter int) error
func (*RateLimiter) TimePerRequests ¶
func (rl *RateLimiter) TimePerRequests() time.Duration
Click to show internal directories.
Click to hide internal directories.