PHP Class Webiny\Component\Cache\Bridge\Memory\Couchbase

Inheritance: extends Jamm\Memory\CouchbaseObject, implements Webiny\Component\Cache\Bridge\CacheStorageInterface
Afficher le fichier Open project: Webiny/Framework

Méthodes publiques

Méthode Description
__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.

Method Details

__construct() public méthode

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

acquireKey() public méthode

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
Résultat boolean

delete() public méthode

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.
Résultat boolean | array If array of keys was passed, on error will be returned array of not deleted keys, or true on success.

deleteByTags() public méthode

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.
Résultat boolean

deleteOld() public méthode

Delete expired cache values.
public deleteOld ( ) : boolean
Résultat boolean

lockKey() public méthode

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
Résultat boolean

selectByCallback() public méthode

Only values of array type will be selected.
public selectByCallback ( callable $callback, boolean $getArray = false ) : mixed
$callback callable ($value_array,$key)
$getArray boolean
Résultat mixed