Toggle navigation
Hot Examples
EN
EN
RU
DE
FR
ES
PT
IT
JP
ZH
KO
PHP
PHP
C#
Java
Go
C++
Python
JS
TS
Search
Home
bandwidthThrottle
tokenBucket
BlockingConsumer
PHP Class bandwidthThrottle\tokenBucket\BlockingConsumer
See link:
Donations
Author:
Markus Malkusch (
[email protected]
)
Show file
Open project: bandwidth-throttle/token-bucket
Class Usage Examples
Public Methods
Method
Description
__construct
(
TokenBucket
$bucket
)
Set the token bucket.
consume
(
integer
$tokens
)
Consumes tokens.
Method Details
__construct()
public
method
Set the token bucket.
public
__construct
(
TokenBucket
$bucket
)
$bucket
TokenBucket
The token bucket.
consume()
public
method
If the underlying token bucket doesn't have sufficient tokens, the consumer blocks until it can consume the tokens.
public
consume
(
integer
$tokens
)
$tokens
integer
The token amount.