SignalQueue
in package
Tags
Table of Contents
Properties
- $handlerId : int
- $signalKey : string
- $signals : array<string|int, T>
- An array of queued signals
Methods
- __construct() : mixed
- Constructor
- flush() : void
- Flushes the queue, removing all signals
- poll() : Generator<string|int, T>
- Returns an iterator returning all signals in the queue and removing them
- pop() : T|null
- Returns the last signal in the queue and removes it from the queue
- push() : void
- Pushes a signal to the queue
- shift() : T|null
- Returns the first signal in the queue and removes it from the queue
- size() : int
- Size of the queue, i.e. the number of signals in the queue
Properties
$handlerId read-only
public
int
$handlerId
$signalKey read-only
public
string
$signalKey
$signals
An array of queued signals
protected
array<string|int, T>
$signals
= []
Methods
__construct()
Constructor
public
__construct(string $signalKey, int $handlerId) : mixed
Parameters
- $signalKey : string
- $handlerId : int
flush()
Flushes the queue, removing all signals
public
flush() : void
poll()
Returns an iterator returning all signals in the queue and removing them
public
poll() : Generator<string|int, T>
Return values
Generator<string|int, T>pop()
Returns the last signal in the queue and removes it from the queue
public
pop() : T|null
Return values
T|nullpush()
Pushes a signal to the queue
public
push(T $signal) : void
Parameters
- $signal : T
shift()
Returns the first signal in the queue and removes it from the queue
public
shift() : T|null
Return values
T|nullsize()
Size of the queue, i.e. the number of signals in the queue
public
size() : int