.. _extensions-extev: .. _ext-ev: ext/ev ++++++ Extension ev. ext/ev is a high performance full-featured event loop written in C. .. code-block:: php stop(); // Stop the watcher if further calls cause more than 10 iterations Ev::iteration() >= 10 and $w->stop(); }); // Create stopped timer. It will be inactive until we start it ourselves $w_stopped = EvTimer::createStopped(10, 5, function($w) { echo 'Callback of a timer created as stopped'.PHP_EOL; // Stop the watcher after 2 iterations Ev::iteration() >= 2 and $w->stop(); }); // Loop until Ev::stop() is called or all of watchers stop Ev::run(); // Start and look if it works $w_stopped->start(); echo 'Run single iteration'.PHP_EOL; Ev::run(Ev::RUN_ONCE); echo 'Restart the second watcher and try to handle the same events, but don\'t block'.PHP_EOL; $w2->again(); Ev::run(Ev::RUN_NOWAIT); $w = new EvTimer(10, 0, function() {}); echo 'Running a blocking loop'.PHP_EOL; Ev::run(); echo 'END'.PHP_EOL; ?> See also `Ev `_ and `libev `_. Connex PHP features ------------------- + `event-loop `_ Specs _____ +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Short name | Extensions/Extev | +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Rulesets | :ref:`All `, :ref:`Appinfo `, :ref:`CE `, :ref:`Changed Behavior ` | +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Exakat since | 0.8.4 | +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | PHP Version | All | +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Severity | | +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Time To Fix | | +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Precision | Very high | +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Available in | `Entreprise Edition `_, `Community Edition `_, `Exakat Cloud `_ | +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+