Toggle navigation
Hot Examples
FR
EN
RU
DE
FR
ES
PT
IT
JP
ZH
KO
PHP
PHP
C#
Java
Go
C++
Python
JS
TS
Rechercher
Accueil
bandwidthThrottle
tokenBucket
BlockingConsumer
PHP Class bandwidthThrottle\tokenBucket\BlockingConsumer
See link:
Donations
Author:
Markus Malkusch (
[email protected]
)
Afficher le fichier
Open project: bandwidth-throttle/token-bucket
Class Usage Examples
Méthodes publiques
Méthode
Description
__construct
(
TokenBucket
$bucket
)
Set the token bucket.
consume
(
integer
$tokens
)
Consumes tokens.
Method Details
__construct()
public
méthode
Set the token bucket.
public
__construct
(
TokenBucket
$bucket
)
$bucket
TokenBucket
The token bucket.
consume()
public
méthode
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.