PHP Интерфейс bandwidthThrottle\tokenBucket\storage\Storage

The storage determines the scope for the token bucket. It therefore implements one of the *Scope marker interfaces: - {@link RequestScope}: The bucket is shared only within one request. - {@link SessionScope}: The bucket is shared between requests of one session. - {@link GlobalScope}: The bucket is shared among all processes.
Автор: Markus Malkusch ([email protected])
Показать файл Открыть проект

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

Метод Описание
bootstrap ( double $microtime ) Bootstraps the storage.
getMicrotime ( ) : double Returns the stored timestamp.
getMutex ( ) : Mutex Returns the Mutex for this storage.
isBootstrapped ( ) : boolean Returns if the storage was already bootstrapped.
remove ( ) Removes the storage.
setMicrotime ( double $microtime ) Stores a timestamp.

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

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

Bootstraps the storage.
public bootstrap ( double $microtime )
$microtime double The timestamp.

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

Returns the stored timestamp.
public getMicrotime ( ) : double
Результат double The timestamp.

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

Returns the Mutex for this storage.
public getMutex ( ) : Mutex
Результат malkusch\lock\mutex\Mutex The mutex.

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

Returns if the storage was already bootstrapped.
public isBootstrapped ( ) : boolean
Результат boolean True if the storage was already bootstrapped.

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

After a storage was removed you should not use that object anymore. The only defined methods after that operations are isBootstrapped() and bootstrap(). A call to bootstrap() results in a defined object again.
public remove ( )

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

Stores a timestamp.
public setMicrotime ( double $microtime )
$microtime double The timestamp.