From da1f814030f9d4f11ae57608add98e51b558b881 Mon Sep 17 00:00:00 2001 From: Ruslan Osmanov Date: Thu, 27 Dec 2012 07:53:59 +0000 Subject: [PATCH] Add: evcheck, evchild, evstat docs Change: Ev: createstopped methods and the watcher factory methods made final git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@328902 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/ev/evcheck/createstopped.xml | 1 + reference/ev/evchild/createstopped.xml | 1 + reference/ev/evembed/createstopped.xml | 1 + reference/ev/evembed/sweep.xml | 2 +- reference/ev/evfork/createstopped.xml | 1 + reference/ev/evidle/createstopped.xml | 1 + reference/ev/evio/createstopped.xml | 1 + reference/ev/evloop/check.xml | 1 + reference/ev/evloop/child.xml | 1 + reference/ev/evloop/embed.xml | 1 + reference/ev/evloop/fork.xml | 1 + reference/ev/evloop/idle.xml | 1 + reference/ev/evloop/io.xml | 1 + reference/ev/evloop/periodic.xml | 1 + reference/ev/evloop/prepare.xml | 1 + reference/ev/evloop/signal.xml | 1 + reference/ev/evloop/stat.xml | 1 + reference/ev/evloop/timer.xml | 1 + reference/ev/evperiodic/createstopped.xml | 1 + reference/ev/evprepare/createstopped.xml | 1 + reference/ev/evsignal/createstopped.xml | 58 ++-- reference/ev/evstat.xml | 75 ++--- reference/ev/evstat/attr.xml | 116 ++++++-- reference/ev/evstat/construct.xml | 71 ++--- reference/ev/evstat/createstopped.xml | 58 ++-- reference/ev/evstat/prev.xml | 36 +-- reference/ev/evstat/stat.xml | 39 +-- reference/ev/evtimer/createstopped.xml | 1 + reference/ev/versions.xml | 346 +++++++++++----------- 29 files changed, 416 insertions(+), 405 deletions(-) diff --git a/reference/ev/evcheck/createstopped.xml b/reference/ev/evcheck/createstopped.xml index 93c57d645e..d5f3d2cd81 100644 --- a/reference/ev/evcheck/createstopped.xml +++ b/reference/ev/evcheck/createstopped.xml @@ -10,6 +10,7 @@ &reftitle.description; + final public static objectEvCheck::createStopped stringcallback stringdata diff --git a/reference/ev/evchild/createstopped.xml b/reference/ev/evchild/createstopped.xml index 992d42e441..2df1cd951d 100644 --- a/reference/ev/evchild/createstopped.xml +++ b/reference/ev/evchild/createstopped.xml @@ -10,6 +10,7 @@ &reftitle.description; + final public static objectEvChild::createStopped intpid booltrace diff --git a/reference/ev/evembed/createstopped.xml b/reference/ev/evembed/createstopped.xml index 3754de8c48..a65bc79cb5 100644 --- a/reference/ev/evembed/createstopped.xml +++ b/reference/ev/evembed/createstopped.xml @@ -10,6 +10,7 @@ &reftitle.description; + final public static voidEvEmbed::createStopped objectother callablecallback diff --git a/reference/ev/evembed/sweep.xml b/reference/ev/evembed/sweep.xml index dc1400a1ab..ed67a177a5 100644 --- a/reference/ev/evembed/sweep.xml +++ b/reference/ev/evembed/sweep.xml @@ -4,7 +4,7 @@ EvEmbed::sweep - The sweep purpose + Make a single, non-blocking sweep over the embedded loop. diff --git a/reference/ev/evfork/createstopped.xml b/reference/ev/evfork/createstopped.xml index 05fe80a679..aad7cee02a 100644 --- a/reference/ev/evfork/createstopped.xml +++ b/reference/ev/evfork/createstopped.xml @@ -10,6 +10,7 @@ &reftitle.description; + final public static objectEvFork::createStopped stringcallback stringdata diff --git a/reference/ev/evidle/createstopped.xml b/reference/ev/evidle/createstopped.xml index 562b8654c7..01cae1f5d6 100644 --- a/reference/ev/evidle/createstopped.xml +++ b/reference/ev/evidle/createstopped.xml @@ -10,6 +10,7 @@ &reftitle.description; + final public static objectEvIdle::createStopped stringcallback mixeddata diff --git a/reference/ev/evio/createstopped.xml b/reference/ev/evio/createstopped.xml index aaed656266..dc0c5841f2 100644 --- a/reference/ev/evio/createstopped.xml +++ b/reference/ev/evio/createstopped.xml @@ -10,6 +10,7 @@ &reftitle.description; + final public static voidEvIo::createStopped stringfd stringevents diff --git a/reference/ev/evloop/check.xml b/reference/ev/evloop/check.xml index d0d4722ac5..fc7c298273 100644 --- a/reference/ev/evloop/check.xml +++ b/reference/ev/evloop/check.xml @@ -11,6 +11,7 @@ &reftitle.description; + final public EvCheckEvLoop::check stringcallback stringdata diff --git a/reference/ev/evloop/child.xml b/reference/ev/evloop/child.xml index a51074ea08..1ce5556da7 100644 --- a/reference/ev/evloop/child.xml +++ b/reference/ev/evloop/child.xml @@ -10,6 +10,7 @@ &reftitle.description; + final public EvChildEvLoop::child stringpid stringtrace diff --git a/reference/ev/evloop/embed.xml b/reference/ev/evloop/embed.xml index 8725f33693..1fb9b15e96 100644 --- a/reference/ev/evloop/embed.xml +++ b/reference/ev/evloop/embed.xml @@ -11,6 +11,7 @@ &reftitle.description; + final public EvEmbedEvLoop::embed stringother stringcallback diff --git a/reference/ev/evloop/fork.xml b/reference/ev/evloop/fork.xml index e9648dbcb0..c30a793b4b 100644 --- a/reference/ev/evloop/fork.xml +++ b/reference/ev/evloop/fork.xml @@ -11,6 +11,7 @@ &reftitle.description; + final public EvForkEvLoop::fork callablecallback &reftitle.description; + final public EvIdleEvLoop::idle callablecallback &reftitle.description; + final public EvIoEvLoop::io mixedfd intevents diff --git a/reference/ev/evloop/periodic.xml b/reference/ev/evloop/periodic.xml index b31834b462..f12791188d 100644 --- a/reference/ev/evloop/periodic.xml +++ b/reference/ev/evloop/periodic.xml @@ -11,6 +11,7 @@ &reftitle.description; + final public EvPeriodicEvLoop::periodic doubleoffset doubleinterval diff --git a/reference/ev/evloop/prepare.xml b/reference/ev/evloop/prepare.xml index 8e6f9db745..c1dd60dede 100644 --- a/reference/ev/evloop/prepare.xml +++ b/reference/ev/evloop/prepare.xml @@ -11,6 +11,7 @@ &reftitle.description; + final public EvPrepareEvLoop::prepare callablecallback &reftitle.description; + final public EvSignalEvLoop::signal intsignum callablecallback diff --git a/reference/ev/evloop/stat.xml b/reference/ev/evloop/stat.xml index f37845a2bf..4cbc4f7915 100644 --- a/reference/ev/evloop/stat.xml +++ b/reference/ev/evloop/stat.xml @@ -11,6 +11,7 @@ &reftitle.description; + final public EvStatEvLoop::stat stringpath doubleinterval diff --git a/reference/ev/evloop/timer.xml b/reference/ev/evloop/timer.xml index 081077277b..6075cef6eb 100644 --- a/reference/ev/evloop/timer.xml +++ b/reference/ev/evloop/timer.xml @@ -11,6 +11,7 @@ &reftitle.description; + final public EvTimerEvLoop::timer doubleafter doublerepeat diff --git a/reference/ev/evperiodic/createstopped.xml b/reference/ev/evperiodic/createstopped.xml index 761c862b2a..624f6611c0 100644 --- a/reference/ev/evperiodic/createstopped.xml +++ b/reference/ev/evperiodic/createstopped.xml @@ -10,6 +10,7 @@ &reftitle.description; + final public static EvPeriodicEvPeriodic::createStopped doubleoffset doubleinterval diff --git a/reference/ev/evprepare/createstopped.xml b/reference/ev/evprepare/createstopped.xml index a8d2b82482..907c30cf4a 100644 --- a/reference/ev/evprepare/createstopped.xml +++ b/reference/ev/evprepare/createstopped.xml @@ -10,6 +10,7 @@ &reftitle.description; + final public static EvPrepareEvPrepare::createStopped callablecallback EvSignal::createStopped - The createStopped purpose + Create stopped EvSignal watcher object &reftitle.description; - public static voidEvSignal::createStopped - stringsignum - stringcallback - stringdata - stringpriority + final + public static EvSignalEvSignal::createStopped + intsignum + callablecallback + mixeddata&null; + intpriority0 - + Create stopped EvSignal watcher object. Unlike + EvSignal::__construct, this method does't + start the watcher automatically. - &warn.undocumented.func; - @@ -31,7 +34,8 @@ signum - + Signal number. You can use one exported by pcntl + extension. See also signal(7) man page. @@ -39,7 +43,7 @@ callback - + See Watcher callbacks. @@ -47,7 +51,7 @@ data - + Custom data associated with the watcher. @@ -55,7 +59,7 @@ priority - + Watcher priority @@ -65,37 +69,15 @@ &reftitle.returnvalues; - + Returns EvSignal object on success. - - &reftitle.examples; - - <function>EvSignal::createStopped</function> example - - -]]> - - &example.outputs.similar; - - - - - - - &reftitle.seealso; - + EvWatcher::start + EvSignal::__construct diff --git a/reference/ev/evstat.xml b/reference/ev/evstat.xml index 8a38c30d6b..09400fc218 100644 --- a/reference/ev/evstat.xml +++ b/reference/ev/evstat.xml @@ -21,32 +21,33 @@ The path does not need to exist: changing from "path exists" to "path does not exist" is a status change like any other. The condition "path does not - exist" is signified by the item 'nlink' being 0 (which is otherwise always forced to be at - least 1) and all the other fields of the Statdata object having unspecified - contents. + exist" is signified by the 'nlink' item being 0(returned by + EvStat::attr method). - The path must not end in a slash or contain special components such as . or - ... The path should be absolute: if it is relative and your working - directory changes, then the behaviour is undefined. + The path must not end in a slash or contain special components such as + '.' or ... The path should be + absolute: if it is relative and your working directory changes, then the + behaviour is undefined. Since there is no portable change notification interface available, the - portable implementation simply calls stat() regularly on the path to see if - it changed somehow. You can specify a recommended polling interval for this - case. If you specify a polling interval of 0.0 (highly recommended!) then a - suitable, unspecified default value will be used (which you can expect to - be around five seconds, although this might change dynamically). libev will - also impose a minimum interval which is currently around 0.1, but that’s - usually overkill. + portable implementation simply calls stat() regularly + on the path to see if it changed somehow. You can specify a recommended + polling interval for this case. If you specify a polling interval of + 0.0 (highly recommended) then a suitable, unspecified + default value will be used(which you can expect to be around five seconds, + although this might change dynamically). libev will + also impose a minimum interval which is currently around + 0.1, but that’s usually overkill. - This watcher type is not meant for massive numbers of Stat watchers, as - even with OS-supported change notifications, this can be - resource-intensive. + This watcher type is not meant for massive numbers of + EvStat watchers, as even with OS-supported change + notifications, this can be resource-intensive. @@ -80,6 +81,8 @@ interval + &InheritedProperties; + &Methods; @@ -97,40 +100,24 @@
&reftitle.properties; - - is_active + + interval - - - - - data - - - - - - is_pending - - - - - - priority - - + + Readonly. + Hint on how quickly a change is expected to be detected and should + normally be specified as 0.0 to let + libev choose a suitable value. + path - - - - - interval - - + + Readonly. + The path to wait for status changes on. + diff --git a/reference/ev/evstat/attr.xml b/reference/ev/evstat/attr.xml index df7f59358a..182f02a8f5 100644 --- a/reference/ev/evstat/attr.xml +++ b/reference/ev/evstat/attr.xml @@ -4,21 +4,19 @@ EvStat::attr - The attr purpose + Returns the values most recently detected by Ev &reftitle.description; - public voidEvStat::attr + public arrayEvStat::attr - + Returns array of the values most recently detected by Ev - &warn.undocumented.func; - @@ -29,37 +27,117 @@ &reftitle.returnvalues; - + Returns array with the values most recently detect by Ev(without actual + stat'ing): + + + List for item keys of the array returned by <methodname>EvStat::attr</methodname> + + + + + Key + Description + + + + + 'dev' + ID of device containing file + + + 'ino' + inode number + + + 'mode' + protection + + + 'nlink' + number of hard links + + + 'uid' + user ID of owner + + + 'size' + total size, in bytes + + + 'gid' + group ID of owner + + + 'rdev' + device ID (if special file) + + + 'blksize' + blocksize for file system I/O + + + 'blocks' + number of 512B blocks allocated + + + 'atime' + time of last access + + + 'ctime' + time of last status change + + + 'mtime' + time of last modification + + + +
+
+ + See stat(2) man page for details.
&reftitle.examples; - - <function>EvStat::attr</function> example - + + Monitor changes of /var/log/messages + attr(); + if ($attr['nlink']) { + printf("Current size: %ld\n", $attr['size']); + printf("Current atime: %ld\n", $attr['atime']); + printf("Current mtime: %ld\n", $attr['mtime']); + } else { + fprintf(STDERR, "`messages` file is not there!"); + $w->stop(); + } +}); + +Ev::run(); ?> ]]> - - &example.outputs.similar; - - - - + + &reftitle.seealso; - + EvStat::prev + EvStat::stat diff --git a/reference/ev/evstat/construct.xml b/reference/ev/evstat/construct.xml index 9759724e6e..9d509fb8fb 100644 --- a/reference/ev/evstat/construct.xml +++ b/reference/ev/evstat/construct.xml @@ -4,7 +4,7 @@ EvStat::__construct - The __construct purpose + Constructs EvStat watcher object @@ -12,17 +12,17 @@ public EvStat::__construct stringpath - stringinterval - stringcallback - stringdata - stringpriority + doubleinterval + callablecallback + mixeddata&null; + intpriority0 - + Constructs EvStat watcher object and starts the watcher automatically. - &warn.undocumented.func; - @@ -32,7 +32,7 @@ path - + The path to wait for status changes on. @@ -40,7 +40,9 @@ interval - + Hint on how quickly a change is expected to be detected and should + normally be specified as 0.0 to let + libev choose a suitable value. @@ -48,7 +50,7 @@ callback - + See Watcher callbacks. @@ -56,7 +58,7 @@ data - + Custom data associated with the watcher. @@ -64,7 +66,7 @@ priority - + Watcher priority @@ -74,38 +76,39 @@ &reftitle.returnvalues; - + Returns EvStat watcher object on succes. &reftitle.examples; - - <function>EvStat::__construct</function> example - + + + Monitor changes of /var/log/messages + attr(); + if ($attr['nlink']) { + printf("Current size: %ld\n", $attr['size']); + printf("Current atime: %ld\n", $attr['atime']); + printf("Current mtime: %ld\n", $attr['mtime']); + } else { + fprintf(STDERR, "`messages` file is not there!"); + $w->stop(); + } +}); + +Ev::run(); ?> ]]> - - &example.outputs.similar; - - - - - - - - - &reftitle.seealso; - - - + + diff --git a/reference/ev/evstat/createstopped.xml b/reference/ev/evstat/createstopped.xml index 359909b6fa..1b345fa019 100644 --- a/reference/ev/evstat/createstopped.xml +++ b/reference/ev/evstat/createstopped.xml @@ -4,25 +4,27 @@ EvStat::createStopped - The createStopped purpose + Create a stopped EvStat watcher object &reftitle.description; + final public static voidEvStat::createStopped stringpath - stringinterval - stringcallback - stringdata - stringpriority + doubleinterval + callablecallback + mixeddata&null; + intpriority0 - + Creates EvStat watcher object, but doesn't start it + automatically(unlike EvStat::__construct). - &warn.undocumented.func; - @@ -32,7 +34,7 @@ path - + The path to wait for status changes on. @@ -40,7 +42,9 @@ interval - + Hint on how quickly a change is expected to be detected and should + normally be specified as 0.0 to let + libev choose a suitable value. @@ -48,7 +52,7 @@ callback - + See Watcher callbacks. @@ -56,7 +60,7 @@ data - + Custom data associated with the watcher. @@ -64,7 +68,7 @@ priority - + Watcher priority @@ -74,37 +78,15 @@ &reftitle.returnvalues; - + Returns a stopped EvStat watcher object on success. - - &reftitle.examples; - - <function>EvStat::createStopped</function> example - - -]]> - - &example.outputs.similar; - - - - - - - &reftitle.seealso; - + EvStat::__construct + EvWatcher::start diff --git a/reference/ev/evstat/prev.xml b/reference/ev/evstat/prev.xml index d6f4369483..c65d754e7f 100644 --- a/reference/ev/evstat/prev.xml +++ b/reference/ev/evstat/prev.xml @@ -4,7 +4,7 @@ EvStat::prev - The prev purpose + Returns the previous set of values returned by EvStat::attr @@ -14,11 +14,10 @@ - + Just like EvStat::attr, but returns the previous + set of values. - &warn.undocumented.func; - @@ -29,37 +28,18 @@ &reftitle.returnvalues; - + Returns an array with the same structure as the array returned by + EvStat::attr. The array contains previously + detected values. - - &reftitle.examples; - - <function>EvStat::prev</function> example - - -]]> - - &example.outputs.similar; - - - - - - &reftitle.seealso; - + EvStat::attr + EvStat::stat diff --git a/reference/ev/evstat/stat.xml b/reference/ev/evstat/stat.xml index 919b03b7eb..21fa9b8de1 100644 --- a/reference/ev/evstat/stat.xml +++ b/reference/ev/evstat/stat.xml @@ -4,21 +4,22 @@ EvStat::stat - The stat purpose + Initiates the stat call &reftitle.description; - public voidEvStat::stat + public boolEvStat::stat + - + Initiates the stat call(updates internal cache). + It stats(using lstat) the path + specified in the watcher and sets to the values found. - &warn.undocumented.func; - @@ -29,37 +30,15 @@ &reftitle.returnvalues; - + Returns &true; if path exists. Otherwise &false;. - - &reftitle.examples; - - <function>EvStat::stat</function> example - - -]]> - - &example.outputs.similar; - - - - - - - &reftitle.seealso; - + EvStat::attr + EvStat::prev diff --git a/reference/ev/evtimer/createstopped.xml b/reference/ev/evtimer/createstopped.xml index 2aaa1eec2e..b78665c7d6 100644 --- a/reference/ev/evtimer/createstopped.xml +++ b/reference/ev/evtimer/createstopped.xml @@ -10,6 +10,7 @@ &reftitle.description; + final public static voidEvTimer::createStopped stringafter stringrepeat diff --git a/reference/ev/versions.xml b/reference/ev/versions.xml index 7baf396590..904a393ea2 100644 --- a/reference/ev/versions.xml +++ b/reference/ev/versions.xml @@ -6,179 +6,179 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +