<?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 => 'tr',
  ),
  'this' => 
  array (
    0 => 'function.eio-custom.php',
    1 => 'eio_custom',
    2 => 'Execute custom request like any other eio_* call',
  ),
  'up' => 
  array (
    0 => 'ref.eio.php',
    1 => 'Eio İşlevleri',
  ),
  'prev' => 
  array (
    0 => 'function.eio-close.php',
    1 => 'eio_close',
  ),
  'next' => 
  array (
    0 => 'function.eio-dup2.php',
    1 => 'eio_dup2',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/eio/functions/eio-custom.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.eio-custom" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">eio_custom</h1>
  <p class="verinfo">(PECL eio &gt;= 0.0.1dev)</p><p class="refpurpose"><span class="refname">eio_custom</span> &mdash; <span class="dc-title">Execute custom request like any other <em>eio_*</em> call</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.eio-custom-description">
  <h3 class="title">Açıklama</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>eio_custom</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.callable.php" class="type callable">callable</a></span> <code class="parameter">$execute</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$pri</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.callable.php" class="type callable">callable</a></span> <code class="parameter">$callback</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">$data</code><span class="initializer"> = NULL</span></span><br>): <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span></div>

  <p class="simpara">
   <span class="function"><strong>eio_custom()</strong></span> executes custom function specified by
   <code class="parameter">execute</code> processing it just like any other <em>eio_*</em> call.
  </p>


 </div>


 <div class="refsect1 parameters" id="refsect1-function.eio-custom-parameters">
  <h3 class="title">Bağımsız Değişkenler</h3>
  <dl>
   
    <dt><code class="parameter">execute</code></dt>
    <dd>
     <p class="para">
      Specifies the request function that should match the following prototype:

      <div class="example-contents"><div class="cdata"><pre>
      mixed execute(mixed data);
      </pre></div></div>

      <code class="parameter">callback</code> is event completion callback that should match the following
      prototype:
      <div class="example-contents"><div class="cdata"><pre>
      void callback(mixed data, mixed result);
      </pre></div></div>


     <code class="parameter">data</code> is the data passed to
     <code class="parameter">execute</code> via <code class="parameter">data</code> argument
      without modifications
      <code class="parameter">result</code> value returned by <code class="parameter">execute</code>
     </p>
    </dd>
   
   
    <dt><code class="parameter">pri</code></dt>
    <dd>
    <p class="para">The request priority: <strong><code><a href="eio.constants.php#constant.eio-pri-default">EIO_PRI_DEFAULT</a></code></strong>, <strong><code><a href="eio.constants.php#constant.eio-pri-min">EIO_PRI_MIN</a></code></strong>, <strong><code><a href="eio.constants.php#constant.eio-pri-max">EIO_PRI_MAX</a></code></strong>, or <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>.
If <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> passed, <code class="parameter">pri</code> internally is set to
<strong><code><a href="eio.constants.php#constant.eio-pri-default">EIO_PRI_DEFAULT</a></code></strong>.
</p>

    </dd>
   
   
    <dt><code class="parameter">callback</code></dt>
    <dd>
     <p class="para">
<code class="parameter">callback</code> function is called when the request is done.
It should match the following prototype: <div class="example-contents"><div class="phpcode"><code><span style="color: #000000">void callback(mixed $data, int $result[, resource $req]);</span></code></div></div>

<dl>
 
  <dt><code class="parameter">data</code></dt>
  <dd><p class="para">is custom data passed to the request.</p></dd>
 
 
  <dt><code class="parameter">result</code></dt>
  <dd><p class="para">request-specific result value; basically, the value returned by corresponding system call.</p></dd>
 
 
  <dt><code class="parameter">req</code></dt>
  <dd><p class="para">is optional request resource which can be used with functions like <span class="function"><a href="function.eio-get-last-error.php" class="function">eio_get_last_error()</a></span>.</p></dd>
 
</dl>
</p>

    </dd>
   
   
    <dt><code class="parameter">data</code></dt>
    <dd>
     <span class="simpara">
     Arbitrary variable passed to <code class="parameter">callback</code>.
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.eio-custom-returnvalues">
  <h3 class="title">Dönen Değerler</h3>
  <p class="simpara">
   <span class="function"><strong>eio_custom()</strong></span> returns request resource on success, başarısızlık durumunda <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> döner.
  </p>
 </div>




 <div class="refsect1 examples" id="refsect1-function.eio-custom-examples">
  <h3 class="title">Örnekler</h3>
  <div class="example" id="example-1">
   <p><strong>Örnek 1 <span class="function"><strong>eio_custom()</strong></span> example</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: #FF8000">/* Callback for the custom callback */<br /></span><span style="color: #007700">function </span><span style="color: #0000BB">my_custom_callback</span><span style="color: #007700">(</span><span style="color: #0000BB">$data</span><span style="color: #007700">, </span><span style="color: #0000BB">$result</span><span style="color: #007700">) {<br />    </span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$data</span><span style="color: #007700">);<br />    </span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">count</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">));<br />    </span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">[</span><span style="color: #DD0000">'data_modified'</span><span style="color: #007700">]);<br />    </span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">[</span><span style="color: #DD0000">'result'</span><span style="color: #007700">]);<br />}<br /><br /></span><span style="color: #FF8000">/* The custom request */<br /></span><span style="color: #007700">function </span><span style="color: #0000BB">my_custom</span><span style="color: #007700">(</span><span style="color: #0000BB">$data</span><span style="color: #007700">) {<br />    </span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$data</span><span style="color: #007700">);<br /><br />    </span><span style="color: #0000BB">$result  </span><span style="color: #007700">= array(<br />        </span><span style="color: #DD0000">'result'        </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">1001</span><span style="color: #007700">,<br />        </span><span style="color: #DD0000">'data_modified' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">"my custom data"</span><span style="color: #007700">,<br />    );<br /><br />    return </span><span style="color: #0000BB">$result</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #0000BB">$data </span><span style="color: #007700">= </span><span style="color: #DD0000">"my_custom_data"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$req </span><span style="color: #007700">= </span><span style="color: #0000BB">eio_custom</span><span style="color: #007700">(</span><span style="color: #DD0000">"my_custom"</span><span style="color: #007700">, </span><span style="color: #0000BB">EIO_PRI_DEFAULT</span><span style="color: #007700">, </span><span style="color: #DD0000">"my_custom_callback"</span><span style="color: #007700">, </span><span style="color: #0000BB">$data</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$req</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">eio_event_loop</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
</div>

<div class="example-contents"><p>
Yukarıdaki örnek şuna benzer bir çıktı üretir:</p></div>
<div class="example-contents screen">
 <div class="examplescode"><pre class="examplescode">resource(4) of type (EIO Request Descriptor)
string(14) &quot;my_custom_data&quot;
string(14) &quot;my_custom_data&quot;
int(2)
string(14) &quot;my custom data&quot;
int(1001)</pre>
</div>
 </div>
  </div>
 </div>


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