Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 828

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>The EvIo class</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="evidle.createstopped.html">EvIdle::createStopped</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="evio.construct.html">EvIo::__construct</a></div>
 <div class="up"><a href="book.ev.html">Ev</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="class.evio" class="reference">
 <h1 class="title">The EvIo class</h1>
 
 <div class="partintro"><p class="verinfo">(PECL ev &gt;= 0.2.0)</p>

  <div class="section" id="evio.intro">
   <h2 class="title">Introduction</h2>
   <p class="para">
    <strong class="classname">EvIo</strong>
    watchers check whether a file descriptor(or socket, or a stream castable
    to numeric file descriptor) is readable or writable in each iteration of
    the event loop, or, more precisely, when reading would not block the
    process and writing would at least be able to write some data. This
    behaviour is called
    <em class="emphasis">level-triggering</em>
    because events are kept receiving as long as the condition persists. To
    stop receiving events just stop the watcher.
   </p>
   <p class="para">
    The number of read and/or write event watchers per
    <em><code class="parameter">fd</code></em>
    is unlimited. Setting all file descriptors to non-blocking mode is also
    usually a good idea(but not required).
   </p>
   <p class="para">
    Another thing to watch out for is that it is quite easy to receive false
    readiness notifications, i.e. the callback might be called with
    <strong><code>Ev::READ</code></strong>
    but a subsequent
    <em class="emphasis">read()</em>
    will actually block because there is no data. It is very easy to get into
    this situation. Thus it is best to always use non-blocking I/O: An extra
    <em class="emphasis">read()</em>
    returning
    <strong><code>EAGAIN</code></strong>
    (or similar) is far preferable to a program hanging until some data
    arrives.
   </p>
   <p class="para">
    If for some reason it is impossible to run the
    <em><code class="parameter">fd</code></em>
    in non-blocking mode, then separately re-test whether a file descriptor is
    really ready. Some people additionally use
    <strong><code>SIGALRM</code></strong>
    and an interval timer, just to be sure thry won&#039;t block infinitely.
   </p>
   <p class="para">
    Always consider using non-blocking mode.
   </p>
  </div>

  <div class="section" id="evio.synopsis">
   <h2 class="title">Class synopsis</h2>


   <div class="classsynopsis">
    <div class="ooclass">
     
    </div>

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

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Properties */</div>
    <div class="fieldsynopsis">
     <span class="modifier">public</span>
      <var class="varname"><a href="class.evio.html#evio.props.fd">$<var class="varname">fd</var></a></var>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">public</span>
      <var class="varname"><a href="class.evio.html#evio.props.events">$<var class="varname">events</var></a></var>
    ;</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Inherited properties */</div>
    <div class="fieldsynopsis">
     <span class="modifier">public</span>
      <var class="varname"><a href="class.evwatcher.html#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.html#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.html#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.html#evwatcher.props.priority">$<var class="varname">priority</var></a></var>
    ;</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Methods */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
    <span class="methodname"><a href="evio.construct.html" class="methodname">__construct</a></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">$fd</code>
   </span>
   , <span class="methodparam">
    <span class="type">int</span>
     <code class="parameter">$events</code>
   </span>
   , <span class="methodparam">
    <span class="type"><a href="language.types.callable.html" class="type callable">callable</a></span>
     <code class="parameter">$callback</code>
   </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">$data</code>
   </span>
   [, <span class="methodparam">
    <span class="type">int</span>
     <code class="parameter">$priority</code>
   </span>
  ]] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span>
   <span class="modifier">public</span>
   <span class="modifier">static</span>
   <span class="type">EvIo</span>
    <span class="methodname"><a href="evio.createstopped.html" class="methodname">createStopped</a></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">$fd</code>
   </span>
   , <span class="methodparam">
    <span class="type">int</span>
     <code class="parameter">$events</code>
   </span>
   , <span class="methodparam">
    <span class="type"><a href="language.types.callable.html" class="type callable">callable</a></span>
     <code class="parameter">$callback</code>
   </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">$data</code>
    <span class="initializer"> = <strong><code>NULL</code></strong></span>
   </span>
   [, <span class="methodparam">
    <span class="type">int</span>
     <code class="parameter">$priority</code>
    <span class="initializer"> = 0</span>
   </span>
  ]] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="type">void</span>
    <span class="methodname"><a href="evio.set.html" class="methodname">set</a></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">$fd</code>
   </span>
   , <span class="methodparam">
    <span class="type">int</span>
     <code class="parameter">$events</code>
   </span>
   )</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Inherited methods */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="type">int</span>
    <span class="methodname"><a href="evwatcher.clear.html" class="methodname">EvWatcher::clear</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">abstract</span>
   <span class="modifier">public</span>
    <span class="methodname"><a href="evwatcher.construct.html" class="methodname">EvWatcher::__construct</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="type">void</span>
    <span class="methodname"><a href="evwatcher.feed.html" class="methodname">EvWatcher::feed</a></span>
    ( <span class="methodparam">
    <span class="type">int</span>
     <code class="parameter">$revents</code>
   </span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="type">EvLoop</span>
    <span class="methodname"><a href="evwatcher.getloop.html" class="methodname">EvWatcher::getLoop</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="type">void</span>
    <span class="methodname"><a href="evwatcher.invoke.html" class="methodname">EvWatcher::invoke</a></span>
    ( <span class="methodparam">
    <span class="type">int</span>
     <code class="parameter">$revents</code>
   </span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="type">bool</span>
    <span class="methodname"><a href="evwatcher.keepalive.html" class="methodname">EvWatcher::keepalive</a></span>
    ([ <span class="methodparam">
    <span class="type">bool</span>
     <code class="parameter">$value</code>
   </span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="type">void</span>
    <span class="methodname"><a href="evwatcher.setcallback.html" class="methodname">EvWatcher::setCallback</a></span>
    ( <span class="methodparam">
    <span class="type"><a href="language.types.callable.html" class="type callable">callable</a></span>
     <code class="parameter">$callback</code>
   </span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="type">void</span>
    <span class="methodname"><a href="evwatcher.start.html" class="methodname">EvWatcher::start</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="type">void</span>
    <span class="methodname"><a href="evwatcher.stop.html" class="methodname">EvWatcher::stop</a></span>
    ( <span class="methodparam">void</span>
   )</div>

   }</div>

  </div>

  <div class="section" id="evio.props">
   <h2 class="title">Properties</h2>
   <dl>

    <dt id="evio.props.fd">
     <span class="term">
      <var class="varname"><var class="varname">fd</var></var>
     </span>
     <dd>

      <p class="para"/>
     </dd>

    </dt>

    <dt id="evio.props.events">
     <span class="term">
      <var class="varname"><var class="varname">events</var></var>
     </span>
     <dd>

      <p class="para"/>
     </dd>

    </dt>

   </dl>

  </div>

 </div>

 
















<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="evio.construct.html">EvIo::__construct</a> — Constructs EvIo watcher object</li><li><a href="evio.createstopped.html">EvIo::createStopped</a> — Create stopped EvIo watcher object</li><li><a href="evio.set.html">EvIo::set</a> — Configures the watcher</li></ul>
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="evidle.createstopped.html">EvIdle::createStopped</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="evio.construct.html">EvIo::__construct</a></div>
 <div class="up"><a href="book.ev.html">Ev</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>