<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.gearmanworker.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'gearmanworker.register.php',
    1 => 'GearmanWorker::register',
    2 => 'Register a function with the job server',
  ),
  'up' => 
  array (
    0 => 'class.gearmanworker.php',
    1 => 'GearmanWorker',
  ),
  'prev' => 
  array (
    0 => 'gearmanworker.options.php',
    1 => 'GearmanWorker::options',
  ),
  'next' => 
  array (
    0 => 'gearmanworker.removeoptions.php',
    1 => 'GearmanWorker::removeOptions',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/gearman/gearmanworker/register.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="gearmanworker.register" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">GearmanWorker::register</h1>
  <p class="verinfo">(PECL gearman &gt;= 0.6.0)</p><p class="refpurpose"><span class="refname">GearmanWorker::register</span> &mdash; <span class="dc-title">Register a function with the job server</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-gearmanworker.register-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>GearmanWorker::register</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$function_name</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$timeout</code><span class="initializer"> = 0</span></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="simpara">
   Registers a function name with the job server with an optional timeout.  The timeout
   specifies how many seconds the server will wait before marking a job as failed.
   If the timeout is set to zero, there is no timeout.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-gearmanworker.register-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt><code class="parameter">function_name</code></dt>
    <dd>
     <span class="simpara">
      The name of a function to register with the job server
     </span>
    </dd>
   
   
    <dt><code class="parameter">timeout</code></dt>
    <dd>
     <span class="simpara">
      An interval of time in seconds
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-gearmanworker.register-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="simpara">
   A standard Gearman return value.
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-gearmanworker.register-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li><span class="methodname"><a href="gearmanworker.unregister.php" class="methodname" rel="rdfs-seeAlso">GearmanWorker::unregister()</a> - Unregister a function name with the job servers</span></li>
   <li><span class="methodname"><a href="gearmanworker.unregisterall.php" class="methodname" rel="rdfs-seeAlso">GearmanWorker::unregisterAll()</a> - Unregister all function names with the job servers</span></li>
  </ul>
 </div>


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