ratelimit

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 2, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Channel

func Channel[T any](ctx context.Context, burst int, tick time.Duration, ch <-chan T) iter.Seq2[T, int]

Channel limits thate rate of ch using a leaky bucket. Returns an iterator of the items sent to the channel as fast as the rate allows.

The bucket will contain (and starts with) burst tokens. Every tick the bucket is filled with another token.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL