<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.eio.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'function.eio-get-event-stream.php',
    1 => 'eio_get_event_stream',
    2 => 'Get stream representing a variable used in internal communications with libeio',
  ),
  'up' => 
  array (
    0 => 'ref.eio.php',
    1 => 'Eio Funktionen',
  ),
  'prev' => 
  array (
    0 => 'function.eio-futime.php',
    1 => 'eio_futime',
  ),
  'next' => 
  array (
    0 => 'function.eio-get-last-error.php',
    1 => 'eio_get_last_error',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/eio/functions/eio-get-event-stream.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.eio-get-event-stream" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">eio_get_event_stream</h1>
  <p class="verinfo">(PECL eio &gt;= 0.3.1b)</p><p class="refpurpose"><span class="refname">eio_get_event_stream</span> &mdash; <span class="dc-title">Get stream representing a variable used in internal communications with libeio</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.eio-get-event-stream-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>eio_get_event_stream</strong></span>(): <span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span></div>

  <p class="simpara">
   <span class="function"><strong>eio_get_event_stream()</strong></span> acquires stream representing a
   variable used in internal communications with libeio. Could be used to bind
   with some event loop provided by other PECL extension, for example
   libevent.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.eio-get-event-stream-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">Diese Funktion besitzt keine Parameter.</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.eio-get-event-stream-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="simpara">
   <span class="function"><strong>eio_get_event_stream()</strong></span> returns stream on success;
   otherwise, <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.eio-get-event-stream-examples">
  <h3 class="title">Beispiele</h3>
  <div class="example" id="example-1">
   <p><strong>Beispiel #1 Using eio with libevent</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">function </span><span style="color: #0000BB">my_eio_poll</span><span style="color: #007700">(</span><span style="color: #0000BB">$fd</span><span style="color: #007700">, </span><span style="color: #0000BB">$events</span><span style="color: #007700">, </span><span style="color: #0000BB">$arg</span><span style="color: #007700">) {<br />    </span><span style="color: #FF8000">/* Some libevent regulation might go here .. */<br />    </span><span style="color: #007700">if (</span><span style="color: #0000BB">eio_nreqs</span><span style="color: #007700">()) {<br />        </span><span style="color: #0000BB">eio_poll</span><span style="color: #007700">();<br />    }<br />    </span><span style="color: #FF8000">/* .. and here */<br /></span><span style="color: #007700">}<br /><br />function </span><span style="color: #0000BB">my_res_cb</span><span style="color: #007700">(</span><span style="color: #0000BB">$d</span><span style="color: #007700">, </span><span style="color: #0000BB">$r</span><span style="color: #007700">) {<br />    </span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$r</span><span style="color: #007700">); </span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$d</span><span style="color: #007700">);<br />}<br /><br /></span><span style="color: #0000BB">$base </span><span style="color: #007700">= </span><span style="color: #0000BB">event_base_new</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$event </span><span style="color: #007700">= </span><span style="color: #0000BB">event_new</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">$fd </span><span style="color: #007700">= </span><span style="color: #0000BB">eio_get_event_stream</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$fd</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">eio_nop</span><span style="color: #007700">(</span><span style="color: #0000BB">EIO_PRI_DEFAULT</span><span style="color: #007700">, </span><span style="color: #DD0000">"my_res_cb"</span><span style="color: #007700">, </span><span style="color: #DD0000">"nop data"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">eio_mkdir</span><span style="color: #007700">(</span><span style="color: #DD0000">"/tmp/abc-eio-temp"</span><span style="color: #007700">, </span><span style="color: #0000BB">0750</span><span style="color: #007700">, </span><span style="color: #0000BB">EIO_PRI_DEFAULT</span><span style="color: #007700">, </span><span style="color: #DD0000">"my_res_cb"</span><span style="color: #007700">, </span><span style="color: #DD0000">"mkdir data"</span><span style="color: #007700">);<br /></span><span style="color: #FF8000">/* some other eio_* calls here ... */<br /><br /><br />// set event flags<br /></span><span style="color: #0000BB">event_set</span><span style="color: #007700">(</span><span style="color: #0000BB">$event</span><span style="color: #007700">, </span><span style="color: #0000BB">$fd</span><span style="color: #007700">, </span><span style="color: #0000BB">EV_READ </span><span style="color: #FF8000">/*| EV_PERSIST*/</span><span style="color: #007700">, </span><span style="color: #DD0000">"my_eio_poll"</span><span style="color: #007700">, array(</span><span style="color: #0000BB">$event</span><span style="color: #007700">, </span><span style="color: #0000BB">$base</span><span style="color: #007700">));<br /><br /></span><span style="color: #FF8000">// set event base<br /></span><span style="color: #0000BB">event_base_set</span><span style="color: #007700">(</span><span style="color: #0000BB">$event</span><span style="color: #007700">, </span><span style="color: #0000BB">$base</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// enable event<br /></span><span style="color: #0000BB">event_add</span><span style="color: #007700">(</span><span style="color: #0000BB">$event</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// start event loop<br /></span><span style="color: #0000BB">event_base_loop</span><span style="color: #007700">(</span><span style="color: #0000BB">$base</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/* The same will be available via buffered libevent interface */<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

   <div class="example-contents"><p>Das oben gezeigte Beispiel erzeugt
eine ähnliche Ausgabe wie:</p></div>
   <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">int(3)
int(0)
string(8) &quot;nop data&quot;
int(0)
string(10) &quot;mkdir data&quot;</pre>
</div>
   </div>
  </div>
 </div>



</div><?php manual_footer($setup); ?>