<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.ev.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'ev.run.php',
    1 => 'Ev::run',
    2 => 'Begin checking for events and calling callbacks for the default
  loop',
  ),
  'up' => 
  array (
    0 => 'class.ev.php',
    1 => 'Ev',
  ),
  'prev' => 
  array (
    0 => 'ev.resume.php',
    1 => 'Ev::resume',
  ),
  'next' => 
  array (
    0 => 'ev.sleep.php',
    1 => 'Ev::sleep',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/ev/ev/run.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="ev.run" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Ev::run</h1>
  <p class="verinfo">(PECL ev &gt;= 0.2.0)</p><p class="refpurpose"><span class="refname">Ev::run</span> &mdash; <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="methodname"><strong>Ev::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"> = ?</span></span>): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>

  <p class="simpara">
   Begin checking for events and calling callbacks
   <em>for the default loop</em>.
   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-ev.run-parameters">
  <h3 class="title">Parameters</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&#039;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&#039;t block at all(fetch/handle events, but don&#039;t wait)</td>
         </tr>

        </tbody>
       
      </table>

     </p>
     <span class="simpara">
      See
      <a href="class.ev.php#ev.constants.run-flags" class="link">the run flag
       constants</a>.
     </span>
    </dd>
   
  </dl>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-ev.run-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="simpara">
   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>
    <span class="methodname"><a href="ev.stop.php" class="methodname" rel="rdfs-seeAlso">Ev::stop()</a> - Stops the default event loop</span>
   </li>
   <li>
    <span class="methodname"><a href="evloop.run.php" class="methodname" rel="rdfs-seeAlso">EvLoop::run()</a> - Begin checking for events and calling callbacks for the loop</span>
   </li>
  </ul>
 </div>

</div><?php manual_footer($setup); ?>