Package throttle defines rate and concurrency controllers for groups. A throttler delegates tasks to an underlying group under certain conditions.

This package defines the following functions:

Rate returns a wrapper that ensures that tasks enter the group no faster than a predefined number per unit time.

Capacity returns a wrapper that restricts the number of active goroutines in the group to be no more than a given limit.

Each of these implementations satisfies group.Interface, allowing them to be composed (i.e., you can combine Rate and Capacity).

Imports 2 package(s) ΒΆ