<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.pool.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'tr',
  ),
  'this' => 
  array (
    0 => 'pool.submit.php',
    1 => 'Pool::submit',
    2 => 'Submits an object for execution',
  ),
  'up' => 
  array (
    0 => 'class.pool.php',
    1 => 'Pool',
  ),
  'prev' => 
  array (
    0 => 'pool.shutdown.php',
    1 => 'Pool::shutdown',
  ),
  'next' => 
  array (
    0 => 'pool.submitTo.php',
    1 => 'Pool::submitTo',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/pthreads/pool/submit.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="pool.submit" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Pool::submit</h1>
  <p class="verinfo">(PECL pthreads &gt;= 2.0.0)</p><p class="refpurpose"><span class="refname">Pool::submit</span> &mdash; <span class="dc-title">Submits an object for execution</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-pool.submit-description">
  <h3 class="title">Açıklama</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>Pool::submit</strong></span>(<span class="methodparam"><span class="type"><a href="class.threaded.php" class="type Threaded">Threaded</a></span> <code class="parameter">$task</code></span>): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>

  <p class="simpara">
  Submit the task to the next Worker in the Pool
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-pool.submit-parameters">
  <h3 class="title">Bağımsız Değişkenler</h3>
  <dl>
   
    <dt><code class="parameter">task</code></dt>
    <dd>
     <span class="simpara">
  The task for execution
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-pool.submit-returnvalues">
  <h3 class="title">Dönen Değerler</h3>
  <p class="simpara">
 the identifier of the Worker executing the object
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-pool.submit-examples">
  <h3 class="title">Örnekler</h3>
  <div class="example" id="example-1">
   <p><strong>Örnek 1 Submitting Tasks</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">class </span><span style="color: #0000BB">MyWork </span><span style="color: #007700">extends </span><span style="color: #0000BB">Threaded </span><span style="color: #007700">{<br /><br />    public function </span><span style="color: #0000BB">run</span><span style="color: #007700">() {<br />        </span><span style="color: #FF8000">/* ... */<br />    </span><span style="color: #007700">}<br />}<br /><br />class </span><span style="color: #0000BB">MyWorker </span><span style="color: #007700">extends </span><span style="color: #0000BB">Worker </span><span style="color: #007700">{<br /><br />    public function </span><span style="color: #0000BB">__construct</span><span style="color: #007700">(</span><span style="color: #0000BB">Something $something</span><span style="color: #007700">) {<br />        </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">something </span><span style="color: #007700">= </span><span style="color: #0000BB">$something</span><span style="color: #007700">;<br />    }<br /><br />    public function </span><span style="color: #0000BB">run</span><span style="color: #007700">() {<br />        </span><span style="color: #FF8000">/** ... **/<br />    </span><span style="color: #007700">}<br />}<br /><br /></span><span style="color: #0000BB">$pool </span><span style="color: #007700">= new </span><span style="color: #0000BB">Pool</span><span style="color: #007700">(</span><span style="color: #0000BB">8</span><span style="color: #007700">, </span><span style="color: #0000BB">\MyWorker</span><span style="color: #007700">::class, [new </span><span style="color: #0000BB">Something</span><span style="color: #007700">()]);<br /></span><span style="color: #0000BB">$pool</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">submit</span><span style="color: #007700">(new </span><span style="color: #0000BB">MyWork</span><span style="color: #007700">());<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$pool</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

   <div class="example-contents"><p>
Yukarıdaki örneğin çıktısı:</p></div>
   <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">object(Pool)#1 (6) {
  [&quot;size&quot;:protected]=&gt;
  int(8)
  [&quot;class&quot;:protected]=&gt;
  string(8) &quot;MyWorker&quot;
  [&quot;workers&quot;:protected]=&gt;
  array(1) {
    [0]=&gt;
    object(MyWorker)#4 (1) {
      [&quot;something&quot;]=&gt;
      object(Something)#5 (0) {
      }
    }
  }
  [&quot;work&quot;:protected]=&gt;
  array(1) {
    [0]=&gt;
    object(MyWork)#3 (1) {
      [&quot;worker&quot;]=&gt;
      object(MyWorker)#5 (1) {
        [&quot;something&quot;]=&gt;
        object(Something)#6 (0) {
        }
      }
    }
  }
  [&quot;ctor&quot;:protected]=&gt;
  array(1) {
    [0]=&gt;
    object(Something)#2 (0) {
    }
  }
  [&quot;last&quot;:protected]=&gt;
  int(1)
}</pre>
</div>
   </div>
  </div>
 </div>


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