<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.gearmanclient.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'gearmanclient.setwarningcallback.php',
    1 => 'GearmanClient::setWarningCallback',
    2 => 'Set a callback for worker warnings',
  ),
  'up' => 
  array (
    0 => 'class.gearmanclient.php',
    1 => 'GearmanClient',
  ),
  'prev' => 
  array (
    0 => 'gearmanclient.settimeout.php',
    1 => 'GearmanClient::setTimeout',
  ),
  'next' => 
  array (
    0 => 'gearmanclient.setworkloadcallback.php',
    1 => 'GearmanClient::setWorkloadCallback',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/gearman/gearmanclient/setwarningcallback.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="gearmanclient.setwarningcallback" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">GearmanClient::setWarningCallback</h1>
  <p class="verinfo">(PECL gearman &gt;= 0.5.0)</p><p class="refpurpose"><span class="refname">GearmanClient::setWarningCallback</span> &mdash; <span class="dc-title">Set a callback for worker warnings</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-gearmanclient.setwarningcallback-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>GearmanClient::setWarningCallback</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.callable.php" class="type callable">callable</a></span> <code class="parameter">$callback</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="simpara">
   Sets a callback function to be called when a worker sends a warning.
  </p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
 <p class="para">
  The callback will only be triggered for tasks that are added (e.g. by calling <span class="methodname"><a href="gearmanclient.addtask.php" class="methodname">GearmanClient::addTask()</a></span>)
  after calling this method.
 </p>
</p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-gearmanclient.setwarningcallback-parameters">
  <h3 class="title">Parameters</h3>
  <dl>
   
 <dt><code class="parameter">callback</code></dt>
 <dd>
  <p class="para">
   A function or method to call.
   It should return a valid <a href="gearman.constants.php" class="link">Gearman return value</a>.
  </p>
  <p class="para">
   If no return statement is present, it defaults to <strong><code><a href="gearman.constants.php#constant.gearman-success">GEARMAN_SUCCESS</a></code></strong>.
  </p>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><span class="replaceable">callback</span></span>(<span class="methodparam"><span class="type"><a href="class.gearmantask.php" class="type GearmanTask">GearmanTask</a></span> <code class="parameter">$task</code></span>, <span class="methodparam"><span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">$context</code></span>): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>

  <dl>
   
    <dt><code class="parameter">task</code></dt>
    <dd>
     <p class="para">
      The task this callback is called for.
     </p>
    </dd>
   
   
    <dt><code class="parameter">context</code></dt>
    <dd>
     <p class="para">
      Whatever has been passed to <span class="methodname"><a href="gearmanclient.addtask.php" class="methodname">GearmanClient::addTask()</a></span> (or equivalent method) as <code class="parameter">context</code>.
     </p>
    </dd>
   
  </dl>
 </dd>

  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-gearmanclient.setwarningcallback-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="simpara">
   Returns <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> on success or <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> on failure.
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-gearmanclient.setwarningcallback-seealso">
  <h3 class="title">See Also</h3>
  <ul class="simplelist">
   <li><span class="methodname"><a href="gearmanclient.setdatacallback.php" class="methodname" rel="rdfs-seeAlso">GearmanClient::setDataCallback()</a> - Callback function when there is a data packet for a task</span></li>
   <li><span class="methodname"><a href="gearmanclient.setcompletecallback.php" class="methodname" rel="rdfs-seeAlso">GearmanClient::setCompleteCallback()</a> - Set a function to be called on task completion</span></li>
   <li><span class="methodname"><a href="gearmanclient.setcreatedcallback.php" class="methodname" rel="rdfs-seeAlso">GearmanClient::setCreatedCallback()</a> - Set a callback for when a task is queued</span></li>
   <li><span class="methodname"><a href="gearmanclient.setexceptioncallback.php" class="methodname" rel="rdfs-seeAlso">GearmanClient::setExceptionCallback()</a> - Set a callback for worker exceptions</span></li>
   <li><span class="methodname"><a href="gearmanclient.setfailcallback.php" class="methodname" rel="rdfs-seeAlso">GearmanClient::setFailCallback()</a> - Set callback for job failure</span></li>
   <li><span class="methodname"><a href="gearmanclient.setstatuscallback.php" class="methodname" rel="rdfs-seeAlso">GearmanClient::setStatusCallback()</a> - Set a callback for collecting task status</span></li>
   <li><span class="methodname"><a href="gearmanclient.setworkloadcallback.php" class="methodname" rel="rdfs-seeAlso">GearmanClient::setWorkloadCallback()</a> - Set a callback for accepting incremental data updates</span></li>
  </ul>
 </div>


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