Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrResourceBusy = errors.New("resource busy, try again")
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*options)
func WithMaxQueueLen ¶
WithMaxQueueLen sets the maximum length the queue can grow to.
type Throttler ¶
type Throttler[T any] struct { // contains filtered or unexported fields }
Throttler limits how many times an action is done concurrently and how many requests for these actions can be queued at max.
func NewThrottler ¶
NewThrottler returns a new throttler that will allow up to `maxConcurrentReqs` concurrent requests for resource `T`. See throttler.Option for other options.
func (*Throttler[T]) JobsRunning ¶
JobsRunning returns the number of Do calls that are running at the moment
Click to show internal directories.
Click to hide internal directories.