Sophie

Sophie

distrib > Mageia > 4 > i586 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 1644

php-manual-en-5.5.7-1.mga4.noarch.rpm

<!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>About buffer event callbacks</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="eventbufferevent.writebuffer.html">EventBufferEvent::writeBuffer</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="class.eventconfig.html">EventConfig</a></div>
 <div class="up"><a href="book.event.html">Event</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="eventbufferevent.about.callbacks" class="chapter">
 <h1>About buffer event callbacks</h1>

 <p class="para">
  An object of
  <a href="class.eventbufferevent.html" class="classname">EventBufferEvent</a>
  class represents a
  <em class="emphasis">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="type"><span class="type void">void</span></span>
   <span class="methodname"><strong>callback</strong></span>
   ([ <span class="methodparam">
   <span class="type"><a href="class.eventbufferevent.html" class="type EventBufferEvent">EventBufferEvent</a></span>
    <code class="parameter">$bev</code>
   <span class="initializer"> = <strong><code>NULL</code></strong></span>
  </span>
  [, <span class="methodparam">
   <span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span>
    <code class="parameter">$arg</code>
   <span class="initializer"> = <strong><code>NULL</code></strong></span>
  </span>
 ]] )</div>

 <p class="para">
  <dl>

   <dt>

    <span class="term">
     <em><code class="parameter">bev</code></em>
    </span>
    <dd>

     <p class="para">
      Associated
      <a href="class.eventbufferevent.html" class="classname">EventBufferEvent</a>
      object.
     </p>
    </dd>

   </dt>

   <dt>

    <span class="term">
     <em><code class="parameter">arg</code></em>
    </span>
    <dd>

     <p class="para">
      Custom variable attached to all callbacks via
       <span class="methodname"><a href="eventbufferevent.construct.html" class="methodname">EventBufferEvent::__construct()</a></span>
      , or
       <span class="methodname"><a href="eventbufferevent.setcallbacks.html" class="methodname">EventBufferEvent::setCallbacks()</a></span>
      .
     </p>
    </dd>

   </dt>

  </dl>

 </p>
 <p class="para">
  Event callback should match the following prototype:
 </p>
 <div class="methodsynopsis dc-description">
  <span class="type"><span class="type void">void</span></span>
   <span class="methodname"><strong>callback</strong></span>
   ([ <span class="methodparam">
   <span class="type"><a href="class.eventbufferevent.html" class="type EventBufferEvent">EventBufferEvent</a></span>
    <code class="parameter">$bev</code>
   <span class="initializer"> = <strong><code>NULL</code></strong></span>
  </span>
  [, <span class="methodparam">
   <span class="type">int</span>
    <code class="parameter">$events</code>
   <span class="initializer"> = 0</span>
  </span>
  [, <span class="methodparam">
   <span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span>
    <code class="parameter">$arg</code>
   <span class="initializer"> = <strong><code>NULL</code></strong></span>
  </span>
 ]]] )</div>

 <p class="para">
  <dl>

   <dt>

    <span class="term">
     <em><code class="parameter">bev</code></em>
    </span>
    <dd>

     <p class="para">
      Associated
      <a href="class.eventbufferevent.html" class="classname">EventBufferEvent</a>
      object.
     </p>
    </dd>

   </dt>

   <dt>

    <span class="term">
     <em><code class="parameter">events</code></em>
    </span>
    <dd>

     <p class="para">
      Bit mask of events:
      <strong><code>EventBufferEvent::READING</code></strong>
      ,
      <strong><code>EventBufferEvent::WRITING</code></strong>
      ,
      <strong><code>EventBufferEvent::EOL</code></strong>
      ,
      <strong><code>EventBufferEvent::ERROR</code></strong>
      and
      <strong><code>EventBufferEvent::TIMEOUT</code></strong>
      . See
      <a href="class.eventbufferevent.html#eventbufferevent.constants" class="link">EventBufferEvent constants</a>
     </p>
    </dd>

   </dt>

   <dt>

    <span class="term">
     <em><code class="parameter">arg</code></em>
    </span>
    <dd>

     <p class="para">
      Custom variable attached to all callbacks via
       <span class="methodname"><a href="eventbufferevent.construct.html" class="methodname">EventBufferEvent::__construct()</a></span>
      , or
       <span class="methodname"><a href="eventbufferevent.setcallbacks.html" class="methodname">EventBufferEvent::setCallbacks()</a></span>
      .
     </p>
    </dd>

   </dt>

  </dl>

 </p>
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="eventbufferevent.writebuffer.html">EventBufferEvent::writeBuffer</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="class.eventconfig.html">EventConfig</a></div>
 <div class="up"><a href="book.event.html">Event</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>