Toggle navigation
Hot Examples
PT
EN
RU
DE
FR
ES
PT
IT
JP
ZH
KO
PHP
PHP
C#
Java
Go
C++
Python
JS
TS
Pesquisar
Página Inicial
bandwidthThrottle
tokenBucket
BlockingConsumer
PHP Class bandwidthThrottle\tokenBucket\BlockingConsumer
See link:
Donations
Author:
Markus Malkusch (
[email protected]
)
Exibir arquivo
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.