mediatekformation

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

Properties

$lockLifetime

private mixed $lockLifetime
Tags
psalm-var

numeric-string

Methods

__construct()

public __construct(Region $region, string $directory, numeric-string $lockLifetime) : mixed
Parameters
$region : Region
$directory : string
$lockLifetime : numeric-string
Tags
throws
InvalidArgumentException
Return values
mixed

evictAll()

{@inheritdoc}

public evictAll() : mixed
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.

unlock()

Attempts to read unlock the mapping for the given key.

public unlock(CacheKey $key, Lock $lock) : bool
Parameters
$key : CacheKey

The key of the item to unlock.

$lock : Lock

The lock previously obtained from

Return values
bool

getLockContent()

private getLockContent(string $filename) : string|false
Parameters
$filename : string
Return values
string|false

getLockTime()

private getLockTime(string $filename) : int|false
Parameters
$filename : string
Return values
int|false

Search results