<?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 => 'uk',
  ),
  'this' => 
  array (
    0 => 'eventbufferevent.about.callbacks.php',
    1 => 'About buffer event callbacks',
    2 => 'About buffer event callbacks',
  ),
  'up' => 
  array (
    0 => 'book.event.php',
    1 => 'Event',
  ),
  'prev' => 
  array (
    0 => 'eventbufferevent.writebuffer.php',
    1 => 'EventBufferEvent::writeBuffer',
  ),
  'next' => 
  array (
    0 => 'class.eventconfig.php',
    1 => 'EventConfig',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/event/eventbufferevent.about.callbacks.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="eventbufferevent.about.callbacks" class="chapter">
 <h1 class="title">About buffer event callbacks</h1>

 <p class="para">
  An object of
  <span class="classname"><a href="class.eventbufferevent.php" class="classname">EventBufferEvent</a></span>
  class represents a
  <em>buffer event</em>.
  The asynchronous nature of I/O performed by Libevent implies that a
  socket(or other kind of file descriptor) is not always available. Event
  invokes corresponding callbacks when the resource becomes available for
  reading or writing, or when some event occurs(e.g. error, &quot;end of line&quot;
  etc.).
 </p>
 <p class="para">
  Read and write callbacks should match the following prototype:
 </p>
 <div class="methodsynopsis dc-description">
  <span class="methodname"><strong>callback</strong></span>(<span class="methodparam">
   
   <span class="type"><a href="class.eventbufferevent.php" class="type EventBufferEvent">EventBufferEvent</a></span> <code class="parameter">$bev</code>
   <span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span>
  </span>, <span class="methodparam">
   
   <span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">$arg</code>
   <span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span>
  </span>): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>

 <p class="para">
  <dl>
   
    <dt>
     <code class="parameter">bev</code>
    </dt>
    <dd>
     <p class="para">
      Associated
      <span class="classname"><a href="class.eventbufferevent.php" class="classname">EventBufferEvent</a></span>
      object.
     </p>
    </dd>
   
   
    <dt>
     <code class="parameter">arg</code>
    </dt>
    <dd>
     <p class="para">
      Custom variable attached to all callbacks via
      <span class="methodname"><a href="eventbufferevent.construct.php" class="methodname">EventBufferEvent::__construct()</a></span>,
      or
      <span class="methodname"><a href="eventbufferevent.setcallbacks.php" class="methodname">EventBufferEvent::setCallbacks()</a></span>.
     </p>
    </dd>
   
  </dl>
 </p>
 <p class="para">
  Event callback should match the following prototype:
 </p>
 <div class="methodsynopsis dc-description">
  <span class="methodname"><strong>callback</strong></span>(<span class="methodparam">
   
   <span class="type"><a href="class.eventbufferevent.php" class="type EventBufferEvent">EventBufferEvent</a></span> <code class="parameter">$bev</code>
   <span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span>
  </span>, <span class="methodparam">
   
   <span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$events</code>
   <span class="initializer"> = 0</span>
  </span>, <span class="methodparam">
   
   <span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">$arg</code>
   <span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span>
  </span>): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>

 <p class="para">
  <dl>
   
    <dt>
     <code class="parameter">bev</code>
    </dt>
    <dd>
     <p class="para">
      Associated
      <span class="classname"><a href="class.eventbufferevent.php" class="classname">EventBufferEvent</a></span>
      object.
     </p>
    </dd>
   
   
    <dt>
     <code class="parameter">events</code>
    </dt>
    <dd>
     <p class="para">
      Bit mask of events:
      <strong><code><a href="class.eventbufferevent.php#eventbufferevent.constants.reading">EventBufferEvent::READING</a></code></strong>,
      <strong><code><a href="class.eventbufferevent.php#eventbufferevent.constants.writing">EventBufferEvent::WRITING</a></code></strong>,
      <strong><code>EventBufferEvent::EOL</code></strong>,
      <strong><code><a href="class.eventbufferevent.php#eventbufferevent.constants.error">EventBufferEvent::ERROR</a></code></strong>
      and
      <strong><code><a href="class.eventbufferevent.php#eventbufferevent.constants.timeout">EventBufferEvent::TIMEOUT</a></code></strong>.
      See
      <a href="class.eventbufferevent.php#eventbufferevent.constants" class="link">EventBufferEvent constants</a>
     </p>
    </dd>
   
   
    <dt>
     <code class="parameter">arg</code>
    </dt>
    <dd>
     <p class="para">
      Custom variable attached to all callbacks via
      <span class="methodname"><a href="eventbufferevent.construct.php" class="methodname">EventBufferEvent::__construct()</a></span>,
      or
      <span class="methodname"><a href="eventbufferevent.setcallbacks.php" class="methodname">EventBufferEvent::setCallbacks()</a></span>.
     </p>
    </dd>
   
  </dl>
 </p>
</div>
<?php manual_footer($setup); ?>