Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетили 20839 программистов и 1135 роботов. Сейчас ищут 339 программистов ...
Приступая к работе

Watchers

Вернуться к: Ev

A watcher is an object that gets created to record interest in some event. For instance, the following code waits for STDIN to become readable:

<?php
// Wait until STDIN is readable
$w = new EvIo(STDINEv::READ, function ($watcher$revents) {
 echo 
"STDIN is readable\n";
});
Ev::run(Ev::RUN_ONCE);
?>

All the watcher constructors automatically start the watchers. createStopped methods create stopped watchers(e.g. EvIo::createStopped() )

Note that a watcher will automatically be stopped when the watcher object is destroyed. Therefore, the watcher objects returned by the constructors or factory methods should be kept.

Note also that all methods changing some watcher property( set , priority etc.) automatically stop and start it again if it is active, which means pending events get lost.

See also: Watcher callbacks .



Вернуться к: Ev

© 2024 «PHP.RU — Сообщество PHP-Программистов»
Главная | Форум | Реклама на сайте | Контакты VIP Сувениры
Разработка компании ODware