FileLockRegion
in package
implements
ConcurrentRegion
Very naive concurrent region, based on file locks.
Table of Contents
Interfaces
- ConcurrentRegion
- Defines contract for concurrently managed data region.
Constants
- LOCK_EXTENSION = 'lock'
Properties
- $directory : string
- $lockLifetime : mixed
- $region : Region
Methods
- __construct() : mixed
- contains() : mixed
- {@inheritDoc}
- evict() : mixed
- {@inheritDoc}
- evictAll() : mixed
- {@inheritDoc}
- get() : mixed
- {@inheritDoc}
- getMultiple() : mixed
- {@inheritDoc}
- getName() : mixed
- {@inheritDoc}
- lock() : Lock|null
- Attempts to read lock the mapping for the given key.
- put() : mixed
- {@inheritDoc}
- unlock() : bool
- Attempts to read unlock the mapping for the given key.
- getLockContent() : string|false
- getLockFileName() : string
- getLockTime() : int|false
- isLocked() : bool
Constants
LOCK_EXTENSION
public
mixed
LOCK_EXTENSION
= 'lock'
Properties
$directory
private
string
$directory
$lockLifetime
private
mixed
$lockLifetime
Tags
$region
private
Region
$region
Methods
__construct()
public
__construct(Region $region, string $directory, numeric-string $lockLifetime) : mixed
Parameters
- $region : Region
- $directory : string
- $lockLifetime : numeric-string
Tags
contains()
{@inheritDoc}
public
contains(CacheKey $key) : mixed
Parameters
- $key : CacheKey
evict()
{@inheritDoc}
public
evict(CacheKey $key) : mixed
Parameters
- $key : CacheKey
evictAll()
{@inheritDoc}
public
evictAll() : mixed
get()
{@inheritDoc}
public
get(CacheKey $key) : mixed
Parameters
- $key : CacheKey
getMultiple()
{@inheritDoc}
public
getMultiple(CollectionCacheEntry $collection) : mixed
Parameters
- $collection : CollectionCacheEntry
getName()
{@inheritDoc}
public
getName() : mixed
lock()
Attempts to read lock the mapping for the given key.
public
lock(CacheKey $key) : Lock|null
Parameters
- $key : CacheKey
-
The key of the item to lock.
Return values
Lock|null —A lock instance or NULL if the lock already exists.
put()
{@inheritDoc}
public
put(CacheKey $key, CacheEntry $entry[, Lock|null $lock = null ]) : mixed
Parameters
- $key : CacheKey
- $entry : CacheEntry
- $lock : Lock|null = null
unlock()
Attempts to read unlock the mapping for the given key.
public
unlock(CacheKey $key, Lock $lock) : bool
Parameters
Return values
boolgetLockContent()
private
getLockContent(string $filename) : string|false
Parameters
- $filename : string
Return values
string|falsegetLockFileName()
private
getLockFileName(CacheKey $key) : string
Parameters
- $key : CacheKey
Return values
stringgetLockTime()
private
getLockTime(string $filename) : int|false
Parameters
- $filename : string
Return values
int|falseisLocked()
private
isLocked(CacheKey $key[, Lock|null $lock = null ]) : bool