VISU - PHP Game Framework

SignalQueueLimited extends SignalQueue
in package

The same as SignalQueue, but with a maximum number of signals to queue

Tags
template
extends

Table of Contents

Properties

$handlerId  : int
$maxSignals  : int
The maximum number of signals to queue
$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

$maxSignals

The maximum number of signals to queue

public int $maxSignals = 1024

$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|null

shift()

Returns the first signal in the queue and removes it from the queue

public shift() : T|null
Return values
T|null

size()

Size of the queue, i.e. the number of signals in the queue

public size() : int
Return values
int

        
On this page

Search results