<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/book.ev.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ja',
  ),
  'this' => 
  array (
    0 => 'class.evidle.php',
    1 => 'EvIdle',
    2 => 'The EvIdle class',
  ),
  'up' => 
  array (
    0 => 'book.ev.php',
    1 => 'Ev',
  ),
  'prev' => 
  array (
    0 => 'evfork.createstopped.php',
    1 => 'EvFork::createStopped',
  ),
  'next' => 
  array (
    0 => 'evidle.construct.php',
    1 => 'EvIdle::__construct',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/ev/evidle.xml',
  ),
  'history' => 
  array (
  ),
  'extra_header_links' => 
  array (
    'rel' => 'alternate',
    'href' => '/manual/en/feeds/class.evidle.atom',
    'type' => 'application/atom+xml',
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="class.evidle" class="reference">
 <h1 class="title">The EvIdle class</h1>
 
 <div class="partintro"><p class="verinfo">(PECL ev &gt;= 0.2.0)</p>

  <div class="section" id="evidle.intro">
   <h2 class="title">はじめに</h2>
   <p class="simpara">
    <span class="classname"><strong class="classname">EvIdle</strong></span>
    watchers trigger events when no other events of the same or higher
    priority are pending (
    <span class="classname"><a href="class.evprepare.php" class="classname">EvPrepare</a></span>,
    <span class="classname"><a href="class.evcheck.php" class="classname">EvCheck</a></span>
    and other
    <span class="classname"><strong class="classname">EvIdle</strong></span>
    watchers do not count as receiving
    <em>events</em>
    ).
   </p>
   <p class="simpara">
    Thus, as long as the process is busy handling sockets or timeouts(or even
    signals) of the same or higher priority it will not be triggered. But when
    the process is in idle(or only lower-priority watchers are pending), the
    <span class="classname"><strong class="classname">EvIdle</strong></span>
    watchers are being called once per event loop iteration - until stopped,
    that is, or the process receives more events and becomes busy again with
    higher priority stuff.
   </p>
   <p class="simpara">
    Apart from keeping the process non-blocking(which is a useful on its own
    sometimes),
    <span class="classname"><strong class="classname">EvIdle</strong></span>
    watchers are a good place to do
    <em>&quot;pseudo-background processing&quot;</em>,
    or delay processing stuff to after the event loop has handled all
    outstanding events.
   </p>
   <p class="simpara">
    The most noticeable effect is that as long as any
    <em>idle</em>
    watchers are active, the process will
    <em>not</em>
    block when waiting for new events.
   </p>
  </div>

  <div class="section" id="evidle.synopsis">
   <h2 class="title">クラス概要</h2>


   <div class="classsynopsis">
    <span class="ooclass">
     <strong class="classname"></strong>
    </span>

    <div class="classsynopsisinfo">
     <span class="ooclass">
      <span class="modifier">class</span> <strong class="classname">EvIdle</strong>
     </span>
     <span class="ooclass">
      <span class="modifier">extends</span>
       <a href="class.evwatcher.php" class="classname">EvWatcher</a>
     </span>
     {</div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 継承したプロパティ */</div>
    <div class="fieldsynopsis">
     <span class="modifier">public</span>
      <var class="varname"><a href="class.evwatcher.php#evwatcher.props.is-active">$<var class="varname">is_active</var></a></var>;</div>
<div class="fieldsynopsis"><span class="modifier">public</span>
      <var class="varname"><a href="class.evwatcher.php#evwatcher.props.data">$<var class="varname">data</var></a></var>;</div>
<div class="fieldsynopsis"><span class="modifier">public</span>
      <var class="varname"><a href="class.evwatcher.php#evwatcher.props.is-pending">$<var class="varname">is_pending</var></a></var>;</div>
<div class="fieldsynopsis"><span class="modifier">public</span>
      <var class="varname"><a href="class.evwatcher.php#evwatcher.props.priority">$<var class="varname">priority</var></a></var>;</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* メソッド */</div>
    <div class="constructorsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="methodname"><a href="evidle.construct.php" class="methodname">__construct</a></span>(<span class="methodparam">
    
    <span class="type"><a href="language.types.callable.php" class="type callable">callable</a></span> <code class="parameter">$callback</code>
   </span>, <span class="methodparam">
    
    <span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">$data</code>
   <span class="initializer"> = ?</span></span>, <span class="methodparam">
    
    <span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$priority</code>
   <span class="initializer"> = ?</span></span>)</div>

    <div class="methodsynopsis dc-description"><span class="modifier">final</span>
   <span class="modifier">public</span>
   <span class="modifier">static</span>
   <span class="methodname"><a href="evidle.createstopped.php" class="methodname">createStopped</a></span>(<span class="methodparam">
    
    <span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$callback</code>
   </span>, <span class="methodparam">
    
    <span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">$data</code>
   <span class="initializer"> = ?</span></span>, <span class="methodparam">
    
    <span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$priority</code>
   <span class="initializer"> = ?</span></span>): <span class="type"><a href="language.types.object.php" class="type object">object</a></span></div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 継承したメソッド */</div>
    <div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="evwatcher.clear.php" class="methodname">EvWatcher::clear</a></span>(): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="evwatcher.feed.php" class="methodname">EvWatcher::feed</a></span>(<span class="methodparam">
    
    <span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$revents</code>
   </span>): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="evwatcher.getloop.php" class="methodname">EvWatcher::getLoop</a></span>(): <span class="type"><a href="class.evloop.php" class="type EvLoop">EvLoop</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="evwatcher.invoke.php" class="methodname">EvWatcher::invoke</a></span>(<span class="methodparam">
    
    <span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$revents</code>
   </span>): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="evwatcher.keepalive.php" class="methodname">EvWatcher::keepalive</a></span>(<span class="methodparam">
    
    <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span> <code class="parameter">$value</code>
   <span class="initializer"> = ?</span></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="evwatcher.setcallback.php" class="methodname">EvWatcher::setCallback</a></span>(<span class="methodparam">
    
    <span class="type"><a href="language.types.callable.php" class="type callable">callable</a></span> <code class="parameter">$callback</code>
   </span>): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="evwatcher.start.php" class="methodname">EvWatcher::start</a></span>(): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="evwatcher.stop.php" class="methodname">EvWatcher::stop</a></span>(): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>

   }</div>

  </div>

 </div>

 










<h2>目次</h2><ul class="chunklist chunklist_reference"><li><a href="evidle.construct.php">EvIdle::__construct</a> — Constructs the EvIdle watcher object</li><li><a href="evidle.createstopped.php">EvIdle::createStopped</a> — Creates instance of a stopped EvIdle watcher object</li></ul>
</div>
<?php manual_footer($setup); ?>