<?php include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc'; $TOC = array(); $TOC_DEPRECATED = array(); $PARENTS = array(); include_once dirname(__FILE__) ."/toc/class.evloop.inc"; $setup = array ( 'home' => array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'evloop.run.php', 1 => 'EvLoop::run', 2 => 'Begin checking for events and calling callbacks for the loop', ), 'up' => array ( 0 => 'class.evloop.php', 1 => 'EvLoop', ), 'prev' => array ( 0 => 'evloop.resume.php', 1 => 'EvLoop::resume', ), 'next' => array ( 0 => 'evloop.signal.php', 1 => 'EvLoop::signal', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/ev/evloop/run.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?> <div id="evloop.run" class="refentry"> <div class="refnamediv"> <h1 class="refname">EvLoop::run</h1> <p class="verinfo">(PECL ev >= 0.2.0)</p><p class="refpurpose"><span class="refname">EvLoop::run</span> — <span class="dc-title">Begin checking for events and calling callbacks for the loop</span></p> </div> <div class="refsect1 description" id="refsect1-evloop.run-description"> <h3 class="title">说明</h3> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="methodname"><strong>EvLoop::run</strong></span>(<span class="methodparam"> <span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$flags</code> <span class="initializer"> = 0</span> </span>): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div> <p class="para rdfs-comment"> Begin checking for events and calling callbacks for the current event loop. Returns when a callback calls <span class="methodname"><a href="ev.stop.php" class="methodname">Ev::stop()</a></span> method, or the flags are nonzero(in which case the return value is true) or when there are no active watchers which reference the loop( <span class="methodname"><a href="evwatcher.keepalive.php" class="methodname">EvWatcher::keepalive()</a></span> is <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>), in which case the return value will be <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>. The return value can generally be interpreted as <em>if <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>, there is more work left to do</em>. </p> </div> <div class="refsect1 parameters" id="refsect1-evloop.run-parameters"> <h3 class="title">参数</h3> <dl> <dt> <code class="parameter">flags</code> </dt> <dd> <p class="para"> Optional parameter <code class="parameter">flags</code> can be one of the following: <table class="doctable table"> <caption><strong> List for possible values of <code class="parameter">flags</code> </strong></caption> <thead> <tr> <th> <code class="parameter">flags</code> </th> <th>Description</th> </tr> </thead> <tbody class="tbody"> <tr> <td> <code class="literal">0</code> </td> <td>The default behavior described above</td> </tr> <tr> <td> <strong><code><a href="class.ev.php#ev.constants.run-once">Ev::RUN_ONCE</a></code></strong> </td> <td>Block at most one(wait, but don't loop)</td> </tr> <tr> <td> <strong><code><a href="class.ev.php#ev.constants.run-nowait">Ev::RUN_NOWAIT</a></code></strong> </td> <td>Don't block at all(fetch/handle events, but don't wait)</td> </tr> </tbody> </table> </p> <p class="para"> See <a href="class.ev.php#ev.constants.run-flags" class="link">the run flag constants</a>. </p> </dd> </dl> </div> <div class="refsect1 returnvalues" id="refsect1-evloop.run-returnvalues"> <h3 class="title">返回值</h3> <p class="para"> 没有返回值。 </p> </div> <div class="refsect1 seealso" id="refsect1-evloop.run-seealso"> <h3 class="title">参见</h3> <ul class="simplelist"> <li> <span class="methodname"><a href="evloop.stop.php" class="methodname" rel="rdfs-seeAlso">EvLoop::stop()</a> - Stops the event loop</span> </li> <li> <span class="methodname"><a href="ev.run.php" class="methodname" rel="rdfs-seeAlso">Ev::run()</a> - Begin checking for events and calling callbacks for the default loop</span> </li> </ul> </div> </div><?php manual_footer($setup); ?>