Watcher callbacks
All watchers can be active(waiting for events) or inactive(paused). Only
active watchers will have their callbacks invoked. All callbacks will be
called with at least two arguments:
watcher
- the watcher, and
revents
a bitmask of received events.
Watcher callbacks are passed to the watcher contructors(the classes derived from EvWatcher - EvCheck::__construct() , EvChild::__construct() etc.). A watcher callback should match the following prototype:
$watcher
= NULL
[,
int
$revents
= NULL
]] )
-
watcher
-
The watcher instance(of a class extending EvWatcher ).
-
revents
Each watcher type has its associated bit in
revents
, so one can use the same callback for multiple watchers. The event mask is
named after the type, i.e.
EvChild
(or
EvLoop::child()
) sets
EV::CHILD
,
EvPrepare
(or
EvLoop::prepare()
) sets
Ev::PREPARE
,
EvPeriodic
(or
EvLoop::periodic()
) sets
Ev::PERIODIC
and so on, with the exception of I/O events (which can set both
Ev::READ
and
Ev::WRITE
bits).
- PHP Руководство
- Функции по категориям
- Индекс функций
- Справочник функций
- Расширения для управления процессами программ
- Введение
- Установка и настройка
- Предопределенные константы
- Примеры
- Watchers
- Watcher callbacks
- Periodic watcher operation modes
- The Ev class
- The EvCheck class
- The EvChild class
- The EvEmbed class
- The EvFork class
- The EvIdle class
- The EvIo class
- The EvLoop class
- The EvPeriodic class
- The EvPrepare class
- The EvSignal class
- The EvStat class
- The EvTimer class
- The EvWatcher class
Коментарии
404 Not Found