Handler
in package
Table of Contents
Constants
- DEFAULT_LOCK_TTL_MS : mixed = 30000
Properties
- $lockTtlMs : int
- $state : StateAdapter
- $strategy : Strategy
Methods
- __construct() : mixed
- acquire() : Lock|null
- dequeue() : QueueEntry|null
- enqueue() : int
- extendLock() : bool
- queueDepth() : int
- release() : void
- acquireDebounce() : Lock|null
Constants
DEFAULT_LOCK_TTL_MS
private
mixed
DEFAULT_LOCK_TTL_MS
= 30000
Properties
$lockTtlMs read-only
private
int
$lockTtlMs
= self::DEFAULT_LOCK_TTL_MS
$state read-only
private
StateAdapter
$state
$strategy read-only
private
Strategy
$strategy
= Strategy::Drop
Methods
__construct()
public
__construct(StateAdapter $state[, Strategy $strategy = Strategy::Drop ][, int $lockTtlMs = self::DEFAULT_LOCK_TTL_MS ]) : mixed
Parameters
- $state : StateAdapter
- $strategy : Strategy = Strategy::Drop
- $lockTtlMs : int = self::DEFAULT_LOCK_TTL_MS
acquire()
public
acquire(string $threadId) : Lock|null
Parameters
- $threadId : string
Return values
Lock|nulldequeue()
public
dequeue(string $threadId) : QueueEntry|null
Parameters
- $threadId : string
Return values
QueueEntry|nullenqueue()
public
enqueue(string $threadId, QueueEntry $entry[, int $maxSize = 10 ]) : int
Parameters
- $threadId : string
- $entry : QueueEntry
- $maxSize : int = 10
Return values
intextendLock()
public
extendLock(Lock $lock, int $ttlMs) : bool
Parameters
- $lock : Lock
- $ttlMs : int
Return values
boolqueueDepth()
public
queueDepth(string $threadId) : int
Parameters
- $threadId : string
Return values
intrelease()
public
release(Lock|null $lock) : void
Parameters
- $lock : Lock|null
acquireDebounce()
private
acquireDebounce(string $lockKey) : Lock|null
Parameters
- $lockKey : string