class LockRegistry

LockRegistry is used internally by existing adapters to protect against cache stampede.

It does so by wrapping the computation of items in a pool of locks. Foreach each apps, there can be at most 20 concurrent processes that compute items at the same time and only one per cache-key.

Methods

static array
setFiles(array $files)

Defines a set of existing files that will be used as keys to acquire locks.

static 
compute(callable $callback, ItemInterface $item, bool $save, CacheInterface $pool, Closure $setMetadata = null)

No description

Details

at line 62
static array setFiles(array $files)

Defines a set of existing files that will be used as keys to acquire locks.

Parameters

array $files

Return Value

array The previously defined set of files

at line 78
static compute(callable $callback, ItemInterface $item, bool $save, CacheInterface $pool, Closure $setMetadata = null)

Parameters

callable $callback
ItemInterface $item
bool $save
CacheInterface $pool
Closure $setMetadata