class FileLockRegion implements ConcurrentRegion (View source)

Very naive concurrent region, based on file locks.

Constants

LOCK_EXTENSION

Methods

__construct(Region $region, string $directory, string $lockLifetime)

No description

string
getName()

{inheritdoc}

boolean
contains(CacheKey $key)

{inheritdoc}

CacheEntry|null
get(CacheKey $key)

{inheritdoc}

CacheEntry[]|null
getMultiple(CollectionCacheEntry $collection)

Get all items from the cache identified by $keys.

put(CacheKey $key, CacheEntry $entry, Lock $lock = null)

{inheritdoc}

evict(CacheKey $key)

{inheritdoc}

evictAll()

{inheritdoc}

lock(CacheKey $key)

{inheritdoc}

void
unlock(CacheKey $key, Lock $lock)

{inheritdoc}

Details

__construct(Region $region, string $directory, string $lockLifetime)

Parameters

Region $region
string $directory
string $lockLifetime

Exceptions

InvalidArgumentException

string getName()

{inheritdoc}

Return Value

string The region name

boolean contains(CacheKey $key)

{inheritdoc}

Parameters

CacheKey $key The cache key

Return Value

boolean TRUE if the underlying cache contains corresponding data; FALSE otherwise.

CacheEntry|null get(CacheKey $key)

{inheritdoc}

Parameters

CacheKey $key The key of the item to be retrieved.

Return Value

CacheEntry|null The cached entry or NULL

CacheEntry[]|null getMultiple(CollectionCacheEntry $collection)

Get all items from the cache identified by $keys.

It returns NULL if some elements can not be found.

Parameters

CollectionCacheEntry $collection The collection of the items to be retrieved.

Return Value

CacheEntry[]|null The cached entries or NULL if one or more entries can not be found

put(CacheKey $key, CacheEntry $entry, Lock $lock = null)

{inheritdoc}

Parameters

CacheKey $key The key under which to cache the item.
CacheEntry $entry The entry to cache.
Lock $lock The lock previously obtained.

evict(CacheKey $key)

{inheritdoc}

Parameters

CacheKey $key The key under which to cache the item.

evictAll()

{inheritdoc}

Lock lock(CacheKey $key)

{inheritdoc}

Parameters

CacheKey $key The key of the item to lock.

Return Value

Lock A lock instance or NULL if the lock already exists.

void unlock(CacheKey $key, Lock $lock)

{inheritdoc}

Parameters

CacheKey $key The key of the item to unlock.
Lock $lock The lock previously obtained from {@link readLock}

Return Value

void