select
in package
implements
eventInterface
Interfaces, Classes, Traits and Enums
Table of Contents
- $_eventTimer : array<string|int, mixed>
- All timer event listeners.
- $_exceptEvents : array<string|int, mixed>
- $_exceptFds : array<string|int, mixed>
- Fds waiting for except event.
- $_readEvents : array<string|int, mixed>
- All listeners for read/write event.
- $_readFds : array<string|int, mixed>
- Fds waiting for read event.
- $_scheduler : SplPriorityQueue|null
- timer scheduler.
- $_selectTimeout : int
- select timeout.
- $_signalEvents : array<string|int, mixed>
- event listeners of signal.
- $_timerId : int
- timer id.
- $_writeEvents : array<string|int, mixed>
- All listeners for read/write event.
- $_writeFds : array<string|int, mixed>
- Fds waiting for write event.
- __construct() : mixed
- Construct.
- delay() : int|bool
- Delay the execution of a callback.
- deleteAllTimer() : void
- Delete all timer.
- deleteTimer() : bool
- Delete a timer.
- getTimerCount() : int
- offExcept() : mixed
- {}
- offReadable() : void
- Cancel a callback of stream readable.
- offsignal() : mixed
- {@inheritdoc}
- offWritable() : string|array<string|int, mixed>|object|null
- Cancel a callback of stream writable.
- onExcept() : mixed
- {}
- onReadable() : void
- Execute a callback when a stream resource becomes readable or is closed for reading.
- onSignal() : void
- Execute a callback when a signal is received.
- onWritable() : void
- Execute a callback when a stream resource becomes writable or is closed for writing.
- repeat() : int|bool
- Repeatedly execute a callback.
- run() : void
- Run the event loop.
- signalHandler() : mixed
- Signal handler.
- stop() : void
- Stop event loop.
- tick() : void
- Tick for timer.
Properties
$_eventTimer
All timer event listeners.
private
array<string|int, mixed>
$_eventTimer
= []
[[func, args, flag, timer_interval], ..]
$_exceptEvents
private
array<string|int, mixed>
$_exceptEvents
= []
$_exceptFds
Fds waiting for except event.
private
array<string|int, mixed>
$_exceptFds
= []
$_readEvents
All listeners for read/write event.
private
array<string|int, mixed>
$_readEvents
= []
$_readFds
Fds waiting for read event.
private
array<string|int, mixed>
$_readFds
= []
$_scheduler
timer scheduler.
private
SplPriorityQueue|null
$_scheduler
= null
{['data':timer_id, 'priority':run_timestamp], ..}
$_selectTimeout
select timeout.
private
int
$_selectTimeout
= 100000000
$_signalEvents
event listeners of signal.
private
array<string|int, mixed>
$_signalEvents
= []
$_timerId
timer id.
private
int
$_timerId
= 1
$_writeEvents
All listeners for read/write event.
private
array<string|int, mixed>
$_writeEvents
= []
$_writeFds
Fds waiting for write event.
private
array<string|int, mixed>
$_writeFds
= []
Methods
__construct()
Construct.
public
__construct() : mixed
Return values
mixed —delay()
Delay the execution of a callback.
public
delay(float $delay, mixed $func, mixed $args) : int|bool
Parameters
- $delay : float
- $func : mixed
- $args : mixed
Return values
int|bool —deleteAllTimer()
Delete all timer.
public
deleteAllTimer() : void
Return values
void —deleteTimer()
Delete a timer.
public
deleteTimer(mixed $timer_id) : bool
Parameters
- $timer_id : mixed
Return values
bool —getTimerCount()
public
getTimerCount() : int
Return values
int —offExcept()
{}
public
offExcept(mixed $stream) : mixed
Parameters
- $stream : mixed
Return values
mixed —offReadable()
Cancel a callback of stream readable.
public
offReadable(mixed $stream) : void
Parameters
- $stream : mixed
Return values
void —offsignal()
{@inheritdoc}
public
offsignal(mixed $signal) : mixed
Parameters
- $signal : mixed
Return values
mixed —offWritable()
Cancel a callback of stream writable.
public
offWritable(mixed $stream) : string|array<string|int, mixed>|object|null
Parameters
- $stream : mixed
Return values
string|array<string|int, mixed>|object|null —onExcept()
{}
public
onExcept(mixed $stream, mixed $func) : mixed
Parameters
- $stream : mixed
- $func : mixed
Return values
mixed —onReadable()
Execute a callback when a stream resource becomes readable or is closed for reading.
public
onReadable(mixed $stream, mixed $func) : void
Parameters
- $stream : mixed
- $func : mixed
Return values
void —onSignal()
Execute a callback when a signal is received.
public
onSignal(mixed $signal, mixed $func) : void
Parameters
- $signal : mixed
- $func : mixed
Return values
void —onWritable()
Execute a callback when a stream resource becomes writable or is closed for writing.
public
onWritable(mixed $stream, mixed $func) : void
Parameters
- $stream : mixed
- $func : mixed
Return values
void —repeat()
Repeatedly execute a callback.
public
repeat(float $delay, mixed $func, mixed $args) : int|bool
Parameters
- $delay : float
- $func : mixed
- $args : mixed
Return values
int|bool —run()
Run the event loop.
public
run() : void
Return values
void —signalHandler()
Signal handler.
public
signalHandler(int $signal) : mixed
Parameters
- $signal : int
Return values
mixed —stop()
Stop event loop.
public
stop() : void
Return values
void —tick()
Tick for timer.
protected
tick() : void