PHP Класс Webiny\Component\Cache\Bridge\Memory\Couchbase

Наследование: extends Jamm\Memory\CouchbaseObject, implements Webiny\Component\Cache\Bridge\CacheStorageInterface
Показать файл Открыть проект

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

Метод Описание
__construct ( Couchbase $couchbase ) Constructor.
acquireKey ( string $key, &$autoUnlocker ) : boolean Try to lock key, and if key is already locked - wait, until key will be unlocked.
delete ( string | array $key ) : boolean | array Delete key or array of keys from storage.
deleteByTags ( array | string $tag ) : boolean Delete keys by tags.
deleteOld ( ) : boolean Delete expired cache values.
lockKey ( mixed $key, mixed &$autoUnlockerVariable ) : boolean Get exclusive mutex for key. Key will be still accessible to read and write, but another process can exclude dog-pile effect, if before updating the key he will try to get this mutex.
selectByCallback ( callable $callback, boolean $getArray = false ) : mixed Select from storage via callback function.

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

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

Constructor.
public __construct ( Couchbase $couchbase )
$couchbase Couchbase

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

Time of waiting is defined in max_wait_unlock constant of MemoryObject class.
public acquireKey ( string $key, &$autoUnlocker ) : boolean
$key string Name of the cache key.
$autoUnlocker
Результат boolean

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

Delete key or array of keys from storage.
public delete ( string | array $key ) : boolean | array
$key string | array Key, or array of keys, you wish to delete.
Результат boolean | array If array of keys was passed, on error will be returned array of not deleted keys, or true on success.

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

Delete keys by tags.
public deleteByTags ( array | string $tag ) : boolean
$tag array | string Tag, or an array of tags, for which you wish to delete the cache.
Результат boolean

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

Delete expired cache values.
public deleteOld ( ) : boolean
Результат boolean

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

Get exclusive mutex for key. Key will be still accessible to read and write, but another process can exclude dog-pile effect, if before updating the key he will try to get this mutex.
public lockKey ( mixed $key, mixed &$autoUnlockerVariable ) : boolean
$key mixed Name of the cache key.
$autoUnlockerVariable mixed Pass empty, just declared variable
Результат boolean

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

Only values of array type will be selected.
public selectByCallback ( callable $callback, boolean $getArray = false ) : mixed
$callback callable ($value_array,$key)
$getArray boolean
Результат mixed