PHP Класс Stiphle\Throttle\TimeWindow

Автор: Dave Marshall ([email protected])
Наследование: implements Stiphle\Throttle\ThrottleInterface
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$storage Stiphle\Storage\StorageInterface

Открытые методы

Метод Описание
__construct ( )
getEstimate ( string $key, integer $limit, integer $milliseconds ) : integer Get Estimate (doesn't require lock)
setStorage ( Stiphle\Storage\StorageInterface $storage ) : LeakyBucket Set Storage
throttle ( string $key, integer $limit, integer $milliseconds ) : void Throttle

Защищенные методы

Метод Описание
getStorageKey ( string $key, integer $limit, integer $milliseconds ) : string Get storage key

Описание методов

__construct() публичный Метод

public __construct ( )

getEstimate() публичный Метод

How long would I have to wait to make a 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
Результат integer - the number of milliseconds before this request should be allowed to pass

getStorageKey() защищенный Метод

Get storage key
protected getStorageKey ( string $key, integer $limit, integer $milliseconds ) : string
$key string - A unique key for what we're throttling
$limit integer - How many are allowed
$milliseconds integer - In this many milliseconds
Результат string

setStorage() публичный Метод

Set Storage
public setStorage ( Stiphle\Storage\StorageInterface $storage ) : LeakyBucket
$storage Stiphle\Storage\StorageInterface
Результат LeakyBucket

throttle() публичный Метод

Throttle
public throttle ( string $key, integer $limit, integer $milliseconds ) : void
$key string - A unique key for what we're throttling
$limit integer - How many are allowed
$milliseconds integer - In this many milliseconds
Результат void

Описание свойств

$storage защищенное свойство

protected StorageInterface,Stiphle\Storage $storage
Результат Stiphle\Storage\StorageInterface