revolt
in package
implements
eventInterface
Interfaces, Classes, Traits and Enums
Table of Contents
- $_driver : Driver|null
- $_eventSignal : array<string|int, mixed>
- event listeners of signal.
- $_eventTimer : array<string|int, mixed>
- event listeners of timer.
- $_readEvents : array<string|int, mixed>
- All listeners for read event.
- $_timerId : int
- timer id.
- $_writeEvents : array<string|int, mixed>
- All listeners 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.
- driver() : Driver|null
- {}
- getTimerCount() : int
- offReadable() : void
- Cancel a callback of stream readable.
- offSignal() : void
- Cancel a callback of signal.
- offWritable() : string|array<string|int, mixed>|object|null
- Cancel a callback of stream writable.
- 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.
- stop() : void
- Stop event loop.
Properties
$_driver
private
Driver|null
$_driver
= null
$_eventSignal
event listeners of signal.
private
array<string|int, mixed>
$_eventSignal
= []
$_eventTimer
event listeners of timer.
private
array<string|int, mixed>
$_eventTimer
= []
$_readEvents
All listeners for read event.
private
array<string|int, mixed>
$_readEvents
= []
$_timerId
timer id.
private
int
$_timerId
= 1
$_writeEvents
All listeners for write event.
private
array<string|int, mixed>
$_writeEvents
= []
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 —driver()
{}
public
driver() : Driver|null
Return values
Driver|null —getTimerCount()
public
getTimerCount() : int
Return values
int —offReadable()
Cancel a callback of stream readable.
public
offReadable(mixed $stream) : void
Parameters
- $stream : mixed
Return values
void —offSignal()
Cancel a callback of signal.
public
offSignal(mixed $signal) : void
Parameters
- $signal : mixed
Return values
void —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 —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 $interval, mixed $func, mixed $args) : int|bool
Parameters
- $interval : float
- $func : mixed
- $args : mixed
Return values
int|bool —run()
Run the event loop.
public
run() : void
Return values
void —stop()
Stop event loop.
public
stop() : void