PHP Class bandwidthThrottle\tokenBucket\storage\PHPRedisStorage

This storage is in the global scope. This implementation requires at least phpredis-2.2.4.
Author: Markus Malkusch ([email protected])
Inheritance: implements bandwidthThrottle\tokenBucket\storage\Storage, implements bandwidthThrottle\tokenBucket\storage\scope\GlobalScope
Show file Open project: bandwidth-throttle/token-bucket Class Usage Examples

Public Methods

Method Description
__construct ( string $name, Redis $redis ) Sets the connected Redis API.
bootstrap ( $microtime )
getMicrotime ( )
getMutex ( )
isBootstrapped ( )
remove ( )
setMicrotime ( $microtime )

Method Details

__construct() public method

The Redis API needs to be connected yet. I.e. Redis::connect() was called already.
public __construct ( string $name, Redis $redis )
$name string The resource name.
$redis Redis The Redis API.

bootstrap() public method

public bootstrap ( $microtime )

getMicrotime() public method

public getMicrotime ( )

getMutex() public method

public getMutex ( )

isBootstrapped() public method

public isBootstrapped ( )

remove() public method

public remove ( )

setMicrotime() public method

public setMicrotime ( $microtime )