FileLockRegion
in package
implements
ConcurrentRegion
Very naive concurrent region, based on file locks.
Interfaces, Classes, Traits and Enums
- ConcurrentRegion
- Defines contract for concurrently managed data region.
Table of Contents
- LOCK_EXTENSION = 'lock'
- $directory : string
- $lockLifetime : mixed
- $region : Region
- __construct() : mixed
- contains() : mixed
- {@inheritdoc}
- evict() : mixed
- {@inheritdoc}
- evictAll() : mixed
- {@inheritdoc}
- get() : mixed
- {@inheritdoc}
- getMultiple() : mixed
- {@inheritdoc}
- getName() : mixed
- {@inheritdoc}
- lock() : Lock
- 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
Return values
mixed —contains()
{@inheritdoc}
public
contains(CacheKey $key) : mixed
Parameters
- $key : CacheKey
Return values
mixed —evict()
{@inheritdoc}
public
evict(CacheKey $key) : mixed
Parameters
- $key : CacheKey
Return values
mixed —evictAll()
{@inheritdoc}
public
evictAll() : mixed
Return values
mixed —get()
{@inheritdoc}
public
get(CacheKey $key) : mixed
Parameters
- $key : CacheKey
Return values
mixed —getMultiple()
{@inheritdoc}
public
getMultiple(CollectionCacheEntry $collection) : mixed
Parameters
- $collection : CollectionCacheEntry
Return values
mixed —getName()
{@inheritdoc}
public
getName() : mixed
Return values
mixed —lock()
Attempts to read lock the mapping for the given key.
public
lock(CacheKey $key) : Lock
Parameters
- $key : CacheKey
-
The key of the item to lock.
Return values
Lock —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
Return values
mixed —unlock()
Attempts to read unlock the mapping for the given key.
public
unlock(CacheKey $key, Lock $lock) : bool
Parameters
Return values
bool —getLockContent()
private
getLockContent(string $filename) : string|false
Parameters
- $filename : string
Return values
string|false —getLockFileName()
private
getLockFileName(CacheKey $key) : string
Parameters
- $key : CacheKey
Return values
string —getLockTime()
private
getLockTime(string $filename) : int|false
Parameters
- $filename : string
Return values
int|false —isLocked()
private
isLocked(CacheKey $key[, Lock|null $lock = null ]) : bool