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)

No description

Details

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

static compute(callable $callback, ItemInterface $item, bool $save, CacheInterface $pool)

Parameters

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