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.
Click to show internal directories.
Click to hide internal directories.