<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/book.event.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'event.persistence.php',
    1 => 'About event persistence',
    2 => 'About event persistence',
  ),
  'up' => 
  array (
    0 => 'book.event.php',
    1 => 'Event',
  ),
  'prev' => 
  array (
    0 => 'event.flags.php',
    1 => 'Event flags',
  ),
  'next' => 
  array (
    0 => 'event.callbacks.php',
    1 => 'Event callbacks',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/event/event.persistence.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="event.persistence" class="chapter">
 <h1 class="title">About event persistence</h1>

 <p class="para">
  By default, whenever a pending event becomes active (because its file
  descriptor is ready to read or write, or because its timeout expires), it
  becomes non-pending right before its callback is executed. Thus, to make the
  event pending again one may call
  <span class="methodname"><a href="event.add.php" class="methodname">Event::add()</a></span>
  on it again from inside the callback function.
 </p>
 <p class="para">
  If the
  <strong><code><a href="class.event.php#event.constants.persist">Event::PERSIST</a></code></strong>
  flag is set on an event, however, the event is
  <em>persistent</em>.
  This means that event remains pending even when its callback is activated.
  <span class="methodname"><a href="event.del.php" class="methodname">Event::del()</a></span>
  method can be called to make it non-pending.
 </p>
 <p class="para">
  The timeout on a persistent event resets whenever the event&#039;s callback runs.
  Thus, if one has an event with flags
  <strong><code><a href="class.event.php#event.constants.read">Event::READ</a></code></strong>
  <code class="literal">|</code>
  <strong><code><a href="class.event.php#event.constants.persist">Event::PERSIST</a></code></strong>
  and a timeout of five seconds, the event will become active:
 </p>
 <ol type="1">
  <li class="listitem">
   <p class="para">
    Whenever the socket or file descriptor is ready for reading.
   </p>
  </li>
  <li class="listitem">
   <p class="para">
    Whenever five seconds have passed since the event last became active.
   </p>
  </li>
 </ol>
 <p class="para">
  See also
  <a href="http://www.wangafu.net/~nickm/libevent-book/Ref4_event.html#_about_event_persistence" class="link external">&raquo;&nbsp;Fast
 portable non-blocking network programming with Libevent, About Event
 Persistence</a>
 </p>
</div>
<?php manual_footer($setup); ?>