Properties

$_allEvents

$_allEvents : array

All listeners for read/write event.

Type

array

$_signalEvents

$_signalEvents : array

Event listeners of signal.

Type

array

$_readFds

$_readFds : array

Fds waiting for read event.

Type

array

$_writeFds

$_writeFds : array

Fds waiting for write event.

Type

array

$_exceptFds

$_exceptFds : array

Fds waiting for except event.

Type

array

$_scheduler

$_scheduler : \SplPriorityQueue

Timer scheduler.

{['data':timer_id, 'priority':run_timestamp], ..}

Type

\SplPriorityQueue

$_eventTimer

$_eventTimer : array

All timer event listeners.

[[func, args, flag, timer_interval], ..]

Type

array

$_timerId

$_timerId : integer

Timer id.

Type

integer

$_selectTimeout

$_selectTimeout : integer

Select timeout.

Type

integer

$channel

$channel : array

Paired socket channels

Type

array

Methods

__construct()

__construct() 

Construct.

add()

add(mixed  $fd, integer  $flag, callable  $func, mixed  $args = array()) : boolean

Add event listener to event loop.

Parameters

mixed $fd
integer $flag
callable $func
mixed $args

Returns

boolean

signalHandler()

signalHandler(integer  $signal) 

Signal handler.

Parameters

integer $signal

del()

del(mixed  $fd, integer  $flag) : boolean

Remove event listener from event loop.

Parameters

mixed $fd
integer $flag

Returns

boolean

clearAllTimer()

clearAllTimer() : void

Remove all timers.

loop()

loop() : void

Main loop.

destroy()

destroy() : void

Destroy loop.

getTimerCount()

getTimerCount() : integer

Get timer count.

Returns

integer

tick()

tick() : void

Tick for timer.