Registry / utility / juju-ratelimit

juju-ratelimit

JSON →
library1.0.2gogounverified

Package ratelimit provides an efficient token bucket implementation that can be used to limit the rate of arbitrary things.

go get github.com/juju/ratelimit
INSTALL
IMPORT
SIG · JUJU-RATELIMIT
J
juju-ratelimit
utilitygov1.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ratelimit
github.com/juju/ratelimit

Create a token bucket that allows 10 operations per second.

package main import ( "fmt" "github.com/juju/ratelimit" "time" ) func main() { bucket := ratelimit.NewBucket(10*time.Second, 100) fmt.Println(bucket.TakeAvailable(1)) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.0.2latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
juju-ratelimit — go get juju-ratelimit · libregistry