package
25.1.0+incompatible
Repository: https://github.com/cockroachdb/cockroach.git
Documentation: pkg.go.dev

# Functions

HasErrClosed returns true if this error is or contains an ErrClosed error.
Inf returns the infinite rate limit, which allows any rate and bursts.
LogSlowAcquisition is a SlowAcquisitionFunc.
New returns a new quota pool initialized with a given quota.
NewIntPool creates a new named IntPool.
NewRateLimiter defines a new RateLimiter.
OnAcquisition creates an Option to configure a callback upon acquisition.
OnSlowAcquisition creates an Option to configure a callback upon slow acquisitions.
OnWaitFinish creates an Option to configure a callback which is called when a previously blocked request acquires resources.
OnWaitStart creates an Option to configure a callback which is called when a request blocks and has to wait for quota.
WithCloser allows the client to provide a channel which will lead to the AbstractPool being closed.
WithMinimumWait is used with the RateLimiter to control the minimum duration which a goroutine will sleep waiting for quota to accumulate.
WithTimeSource is used to configure a quotapool to use the provided TimeSource.

# Variables

ErrNotEnoughQuota is returned by IntRequestFuncs when they want to be called again once there's new resources.

# Structs

AbstractPool is an abstract implementation of a pool that stores some unit of Resource.
ErrClosed is returned from Acquire after Close has been called.
IntAlloc is an allocated quantity which should be released.
IntPool manages allocating integer units of quota to clients.
IntPoolCloser implements stop.Closer.
PoolInfo represents the information that the IntRequestFunc gets about the current quota pool conditions.
RateAlloc is an allocated quantity of quota which can be released back into the token-bucket RateLimiter.
RateLimiter implements a token-bucket style rate limiter.

# Interfaces

Option is used to configure a quotapool.
Request is an interface used to acquire quota from the pool.
Resource is an interface that represents a quantity which is being pooled and allocated.

# Type aliases

AcquisitionFunc is used to configure a quotapool to call a function after an acquisition has occurred.
IntRequestFunc is used to request a quantity of quota determined when quota is available rather than before requesting.
Limit defines a rate in terms of quota per second.
OnWaitStartFunc is the prototype for functions called to notify the start or finish of a waiting period when a request is blocked.
SlowAcquisitionFunc is used to configure a quotapool to call a function when quota acquisition is slow.
UpdateFunc is used to update a resource.