\Workerman\Events\ReactBase

Class StreamSelectLoop

Summary

Methods
Properties
Constants
__construct()
add()
del()
loop()
destroy()
getTimerCount()
addReadStream()
addWriteStream()
removeReadStream()
removeWriteStream()
addTimer()
addPeriodicTimer()
cancelTimer()
futureTick()
addSignal()
removeSignal()
run()
stop()
No public properties found
No constants found
No protected methods found
$_timerIdMap
$_timerIdIndex
$_signalHandlerMap
$_eventLoop
N/A
No private methods found
No private properties found
N/A

Properties

$_timerIdMap

$_timerIdMap : array

Type

array

$_timerIdIndex

$_timerIdIndex : int

Type

int

$_signalHandlerMap

$_signalHandlerMap : array

Type

array

$_eventLoop

$_eventLoop : \React\EventLoop\LoopInterface

Type

\React\EventLoop\LoopInterface —

Methods

__construct()

__construct() : mixed

Base constructor.

Returns

mixed —

add()

add(int  $fd, int  $flag, callable  $func, array  $args = array()) : bool

Add event listener to event loop.

Parameters

int $fd
int $flag
callable $func
array $args

Returns

bool —

del()

del(mixed  $fd, int  $flag) : bool

Remove event listener from event loop.

Parameters

mixed $fd
int $flag

Returns

bool —

loop()

loop() : void

Main loop.

destroy()

destroy() : void

Destroy loop.

getTimerCount()

getTimerCount() : int

Get timer count.

Returns

int —

addReadStream()

addReadStream(resource  $stream, callable  $listener) : mixed

Parameters

resource $stream
callable $listener

Returns

mixed —

addWriteStream()

addWriteStream(resource  $stream, callable  $listener) : mixed

Parameters

resource $stream
callable $listener

Returns

mixed —

removeReadStream()

removeReadStream(resource  $stream) : mixed

Parameters

resource $stream

Returns

mixed —

removeWriteStream()

removeWriteStream(resource  $stream) : mixed

Parameters

resource $stream

Returns

mixed —

addTimer()

addTimer(float|int  $interval, callable  $callback) : \React\EventLoop\Timer\Timer|\React\EventLoop\TimerInterface

Parameters

float|int $interval
callable $callback

Returns

\React\EventLoop\Timer\Timer|\React\EventLoop\TimerInterface —

addPeriodicTimer()

addPeriodicTimer(float|int  $interval, callable  $callback) : \React\EventLoop\Timer\Timer|\React\EventLoop\TimerInterface

Parameters

float|int $interval
callable $callback

Returns

\React\EventLoop\Timer\Timer|\React\EventLoop\TimerInterface —

cancelTimer()

cancelTimer(\React\EventLoop\TimerInterface  $timer) : mixed

Parameters

\React\EventLoop\TimerInterface $timer

Returns

mixed —

futureTick()

futureTick(callable  $listener) : mixed

Parameters

callable $listener

Returns

mixed —

addSignal()

addSignal(int  $signal, callable  $listener) : mixed

Parameters

int $signal
callable $listener

Returns

mixed —

removeSignal()

removeSignal(int  $signal, callable  $listener) : mixed

Parameters

int $signal
callable $listener

Returns

mixed —

run()

run() : mixed

Run.

Returns

mixed —

stop()

stop() : mixed

Stop.

Returns

mixed —