Registry / networking / bandwidth-throttle-token-bucket

bandwidth-throttle-token-bucket

JSON →
library2.0.0phppackagistunverified

Implementation of the Token Bucket algorithm for rate limiting.

composer require bandwidth-throttle/token-bucket
INSTALL
IMPORT
SIG · BANDWIDTH-THROTTLE
B
bandwidth-throttle-token-bucket
networkingphpv2.0.0
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.

TokenBucket
use BandwidthThrottle\TokenBucket\TokenBucket;

Create a token bucket with capacity 100 and rate 10 tokens per second.

use BandwidthThrottle\TokenBucket\TokenBucket; $bucket = new TokenBucket(100, 10); if ($bucket->consume(1)) { // proceed }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
2.0.0latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
18 hits · last 30 days
node
16
OpenAI (training)
1
Resources
bandwidth-throttle-token-bucket — pip install bandwidth-throttle-token-bucket · libregistry