diff --git a/reference/ev/ev.xml b/reference/ev/ev.xml index 00d867830d..528812cfe6 100644 --- a/reference/ev/ev.xml +++ b/reference/ev/ev.xml @@ -28,6 +28,7 @@ + final Ev @@ -606,7 +607,7 @@ Ev::BACKEND_EPOLL - Linux-specific epoll(7) backendf or both pre- and post-2.6.9 kernels + Linux-specific epoll(7) backend for both pre- and post-2.6.9 kernels @@ -687,7 +688,7 @@ Ev::iteration, Ev::depth etc.) For custom loops(created with EvLoop::__construct) you can access these values - via corresponding properties and methods of EvLoop + via corresponding properties and methods of the EvLoop class. diff --git a/reference/ev/evperiodic/construct.xml b/reference/ev/evperiodic/construct.xml index d8b3919f61..ecddf29b55 100644 --- a/reference/ev/evperiodic/construct.xml +++ b/reference/ev/evperiodic/construct.xml @@ -14,12 +14,16 @@ doubleoffset stringinterval callablereschedule_cb - stringcallback - stringdata - stringpriority + callablecallback + mixeddata&null; + intpriority0 - Constructs EvPeriodic watcher object + Constructs EvPeriodic watcher object and starts it automatically. If you + need a stopped watcher consider using + EvPeriodic::createStopped method. @@ -31,8 +35,7 @@ offset - See Periodic watcher operation - modes + See Periodic watcher operation modes @@ -40,8 +43,7 @@ interval - See Periodic watcher operation - modes + See Periodic watcher operation modes @@ -49,7 +51,7 @@ reschedule_cb - Rescheduler callback. You can pass &null;. + Reschedule callback. You can pass &null;. See Periodic watcher operation modes @@ -59,7 +61,7 @@ callback - + See Watcher callbacks. @@ -67,7 +69,7 @@ data - + Custom data associated with the watcher. @@ -75,7 +77,7 @@ priority - + Watcher priority @@ -85,37 +87,73 @@ &reftitle.returnvalues; - + Returns EvPeriodic object on success. &reftitle.examples; - - <function>EvPeriodic::__construct</function> example - + + + Periodic timer. Use reschedule callback + + +]]> + + + + + Periodic timer. Tick every 10.5 seconds starting at now + + ]]> - - &example.outputs.similar; - - - - - + + + + Hourly watcher + + +]]> + + + + &reftitle.seealso; - + + Periodic watcher operation modes + + EvTimer + EvPeriodic::createStopped diff --git a/reference/ev/evperiodic/createstopped.xml b/reference/ev/evperiodic/createstopped.xml index 62ad7fb2bf..761c862b2a 100644 --- a/reference/ev/evperiodic/createstopped.xml +++ b/reference/ev/evperiodic/createstopped.xml @@ -4,25 +4,28 @@ EvPeriodic::createStopped - The createStopped purpose + Create a stopped EvPeriodic watcher &reftitle.description; - public static voidEvPeriodic::createStopped - stringoffset - stringinterval - stringcallback - stringdata - stringpriority + public static EvPeriodicEvPeriodic::createStopped + doubleoffset + doubleinterval + callablereschedule_cb + callablecallback + mixeddata&null; + intpriority0 - + Create EvPeriodic object. Unlike + EvPeriodic::__construct this method doesn't start + the watcher automatically. - &warn.undocumented.func; - @@ -32,7 +35,7 @@ offset - + See Periodic watcher operation modes @@ -40,7 +43,17 @@ interval - + See Periodic watcher operation modes + + + + + reschedule_cb + + + Reschedule callback. You can pass &null;. + See Periodic watcher operation + modes @@ -48,7 +61,7 @@ callback - + See Watcher callbacks. @@ -56,7 +69,7 @@ data - + Custom data associated with the watcher. @@ -64,7 +77,7 @@ priority - + Watcher priority @@ -74,37 +87,15 @@ &reftitle.returnvalues; - + Returns EvPeriodic watcher object on success. - - &reftitle.examples; - - <function>EvPeriodic::createStopped</function> example - - -]]> - - &example.outputs.similar; - - - - - - - &reftitle.seealso; - + EvPeriodic::__construct + EvTimer::createStopped diff --git a/reference/ev/evperiodic/set.xml b/reference/ev/evperiodic/set.xml index f6dd184c68..b2164e12f8 100644 --- a/reference/ev/evperiodic/set.xml +++ b/reference/ev/evperiodic/set.xml @@ -4,22 +4,20 @@ EvPeriodic::set - The set purpose + Configures the watcher &reftitle.description; public voidEvPeriodic::set - stringoffset - stringinterval + doubleoffset + doubleinterval - + (Re-)Configures EvPeriodic watcher - &warn.undocumented.func; - @@ -29,7 +27,8 @@ offset - + The same meaning as for EvPeriodic::__construct. + See Periodic watcher operation modes @@ -37,7 +36,8 @@ interval - + The same meaning as for EvPeriodic::__construct. + See Periodic watcher operation modes @@ -47,40 +47,10 @@ &reftitle.returnvalues; - + &return.void; - - &reftitle.examples; - - <function>EvPeriodic::set</function> example - - -]]> - - &example.outputs.similar; - - - - - - - - - &reftitle.seealso; - - - - -
&reftitle.intro; - - + + EvSignal watchers will trigger an event when the process receives a specific + signal one or more times. Even though signals are very asynchronous, libev + will try its best to deliver signals synchronously, i.e. as part of the + normal event processing, like any other event. + + + You can configure as many watchers as you like for the same signal, but + only within the same loop, i.e. you can watch for + SIGINT in the default loop and for + SIGIO in another loop, but you cannot watch for + SIGINT in both the default loop and another loop at + the same time. At the moment, SIGCHLD is permanently + tied to the default loop. + + + + If possible and supported, libev will install its + handlers with SA_RESTART (or equivalent) behaviour + enabled, so system calls should not be unduly interrupted. If you have a + problem with system calls getting interrupted by signals you can block all + signals in an EvCheck watcher and unblock them in a + EvPrepare watcher. + +
@@ -42,6 +65,8 @@ signum + &InheritedProperties; + &Methods; @@ -59,34 +84,13 @@
&reftitle.properties; - - is_active - - - - - - data - - - - - - is_pending - - - - - - priority - - - - signum - + Signal number. You can use constants exported by + pcntl extension. See also + signal(7) man page. + diff --git a/reference/ev/evsignal/construct.xml b/reference/ev/evsignal/construct.xml index 59f265699c..58148b0558 100644 --- a/reference/ev/evsignal/construct.xml +++ b/reference/ev/evsignal/construct.xml @@ -4,24 +4,25 @@ EvSignal::__construct - The __construct purpose + Constructs EvPeriodic watcher object &reftitle.description; public EvSignal::__construct - stringsignum - stringcallback - stringdata - stringpriority + intsignum + callablecallback + mixeddata&null; + intpriority0 - + Constructs EvPeriodic watcher object. If you need a stopped watcher, + consider using EvSignal::createStopped. - &warn.undocumented.func; - @@ -31,7 +32,8 @@ signum - + Signal number. You can use one exported by pcntl + extension. See also signal(7) man page. @@ -39,7 +41,7 @@ callback - + See Watcher callbacks. @@ -47,7 +49,7 @@ data - + Custom data associated with the watcher. @@ -55,7 +57,7 @@ priority - + Watcher priority @@ -65,37 +67,33 @@ &reftitle.returnvalues; - + Returns EvSignal object on success. &reftitle.examples; - - <function>EvSignal::__construct</function> example - + + Handle SIGTERM signal + stop(); +}); +Ev::run(); ?> ]]> - - &example.outputs.similar; - - - - + + &reftitle.seealso; - + EvSignal::createStopped diff --git a/reference/ev/evsignal/set.xml b/reference/ev/evsignal/set.xml index 7cab765502..806ef1c2fd 100644 --- a/reference/ev/evsignal/set.xml +++ b/reference/ev/evsignal/set.xml @@ -4,21 +4,19 @@ EvSignal::set - The set purpose + Configures the watcher &reftitle.description; public voidEvSignal::set - stringsignum + intsignum - + Configures the watcher. - &warn.undocumented.func; - @@ -28,7 +26,7 @@ signum - + Signal number. The same as for EvSignal::__construct @@ -38,40 +36,10 @@ &reftitle.returnvalues; - + &return.void; - - &reftitle.examples; - - <function>EvSignal::set</function> example - - -]]> - - &example.outputs.similar; - - - - - - - - - &reftitle.seealso; - - - - - diff --git a/reference/ev/evwatcher.xml b/reference/ev/evwatcher.xml index 56dc250755..c54c3c0151 100644 --- a/reference/ev/evwatcher.xml +++ b/reference/ev/evwatcher.xml @@ -12,7 +12,11 @@
&reftitle.intro; - + EvWatcher is a base class for all + watchers(EvCheck, EvChild + etc.). Since EvWatcher's constructor is + abstract, you can't(and don't need to) create + EvWatcher objects directly.
@@ -88,8 +92,8 @@ priority - Integer between EV_MINPRI and - EV_MAXPRI. Pending watchers with higher priority + Integer between Ev::MINPRI and + Ev::MAXPRI. Pending watchers with higher priority will be invoked before watchers with lower priority, but priority will not keep watchers from being executed(except for EvIdle watchers). If you need to suppress