Property | Type | Description | |
---|---|---|---|
$storage | Stiphle\Storage\StorageInterface |
Method | Description | |
---|---|---|
__construct ( ) | ||
getEstimate ( string $key, integer $limit, integer $milliseconds ) : integer | Get Estimate (doesn't require lock) | |
setStorage ( Stiphle\Storage\StorageInterface $storage ) : |
Set Storage | |
throttle ( string $key, integer $limit, integer $milliseconds ) : void | Throttle |
Method | Description | |
---|---|---|
getLastRatio ( string $key ) : float | Get Last Ratio | |
getLastRequest ( string $key ) : float | Get Last Request | |
getNewRatio ( string $key, integer $limit, integer $milliseconds ) : float | Get new ratio | |
getStorageKey ( string $key, integer $limit, integer $milliseconds ) : string | Get storage key | |
setLastRatio ( string $key, float $ratio ) : void | Set Last Ratio | |
setLastRequest ( string $key, float $request ) : void | Set Last Request |
public getEstimate ( string $key, integer $limit, integer $milliseconds ) : integer | ||
$key | string | - A unique key for what we're throttling |
$limit | integer | - How many are allowed |
$milliseconds | integer | - In this many milliseconds |
return | integer | - the number of milliseconds before this request should be allowed to pass |
protected getLastRatio ( string $key ) : float | ||
$key | string | |
return | float |
protected getLastRequest ( string $key ) : float | ||
$key | string | |
return | float |
public setStorage ( Stiphle\Storage\StorageInterface $storage ) : |
||
$storage | Stiphle\Storage\StorageInterface | |
return |