<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Begin checking for events and calling callbacks for the default loop</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="ev.resume.html">Ev::resume</a></div> <div class="next" style="text-align: right; float: right;"><a href="ev.sleep.html">Ev::sleep</a></div> <div class="up"><a href="class.ev.html">Ev</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="ev.run" class="refentry"> <div class="refnamediv"> <h1 class="refname">Ev::run</h1> <p class="verinfo">(PECL ev >= 0.2.0)</p><p class="refpurpose"><span class="refname">Ev::run</span> — <span class="dc-title">Begin checking for events and calling callbacks for the default loop</span></p> </div> <div class="refsect1 description" id="refsect1-ev.run-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="modifier">final</span> <span class="modifier">public</span> <span class="modifier">static</span> <span class="type"><span class="type void">void</span></span> <span class="methodname"><strong>Ev::run</strong></span> ([ <span class="methodparam"> <span class="type">int</span> <code class="parameter">$flags</code> </span> ] )</div> <p class="para rdfs-comment"> Begin checking for events and calling callbacks <em class="emphasis">for the default loop</em> . Returns when a callback calls <span class="methodname"><a href="ev.stop.html" 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.html" class="methodname">EvWatcher::keepalive()</a></span> is <strong><code>TRUE</code></strong>), in which case the return value will be <strong><code>FALSE</code></strong>. The return value can generally be interpreted as <em class="emphasis">if <strong><code>TRUE</code></strong>, there is more work left to do</em> . </p> </div> <div class="refsect1 parameters" id="refsect1-ev.run-parameters"> <h3 class="title">Parameters</h3> <dl> <dt> <span class="term"> <em><code class="parameter">flags</code></em> </span> <dd> <p class="para"> Optional parameter <em><code class="parameter">flags</code></em> can be one of the following: <table class="doctable table"> <caption><strong> List for possible values of <em><code class="parameter">flags</code></em> </strong></caption> <thead> <tr> <th> <em><code class="parameter">flags</code></em> </th> <th>Description</th> </tr> </thead> <tbody class="tbody"> <tr> <td> <strong><code>0</code></strong> </td> <td>The default behavior described above</td> </tr> <tr> <td> <strong><code>Ev::RUN_ONCE</code></strong> </td> <td>Block at most one(wait, but don't loop)</td> </tr> <tr> <td> <strong><code>Ev::RUN_NOWAIT</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.html#ev.constants.run-flags" class="link">the run flag constants</a> . </p> </dd> </dt> </dl> </div> <div class="refsect1 returnvalues" id="refsect1-ev.run-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> No value is returned. </p> </div> <div class="refsect1 seealso" id="refsect1-ev.run-seealso"> <h3 class="title">See Also</h3> <ul class="simplelist"> <li class="member"> <span class="methodname"><a href="ev.stop.html" class="methodname" rel="rdfs-seeAlso">Ev::stop()</a> - Stops the default event loop</span> </li> <li class="member"> <span class="methodname"><a href="evloop.run.html" class="methodname" rel="rdfs-seeAlso">EvLoop::run()</a> - Begin checking for events and calling callbacks for the loop</span> </li> </ul> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="ev.resume.html">Ev::resume</a></div> <div class="next" style="text-align: right; float: right;"><a href="ev.sleep.html">Ev::sleep</a></div> <div class="up"><a href="class.ev.html">Ev</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>