<?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 => 'fr',
  ),
  'this' => 
  array (
    0 => 'gearmanclient.setfailcallback.php',
    1 => 'GearmanClient::setFailCallback',
    2 => 'D&eacute;finit une fonction de rappel &agrave; appeler lorsqu\'un travail &eacute;choue',
  ),
  'up' => 
  array (
    0 => 'class.gearmanclient.php',
    1 => 'GearmanClient',
  ),
  'prev' => 
  array (
    0 => 'gearmanclient.setexceptioncallback.php',
    1 => 'GearmanClient::setExceptionCallback',
  ),
  'next' => 
  array (
    0 => 'gearmanclient.setoptions.php',
    1 => 'GearmanClient::setOptions',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/gearman/gearmanclient/setfailcallback.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="gearmanclient.setfailcallback" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">GearmanClient::setFailCallback</h1>
  <p class="verinfo">(PECL gearman &gt;= 0.5.0)</p><p class="refpurpose"><span class="refname">GearmanClient::setFailCallback</span> &mdash; <span class="dc-title">Définit une fonction de rappel à appeler lorsqu&#039;un travail échoue</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-gearmanclient.setfailcallback-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>GearmanClient::setFailCallback</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">
   Définit une fonction de rappel à utiliser lorsqu&#039;une tâche échoue.
  </p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
 <p class="para">
  Le callback ne sera déclenché que pour les tâches qui sont ajoutées (par exemple en appelant <span class="methodname"><a href="gearmanclient.addtask.php" class="methodname">GearmanClient::addTask()</a></span>)
  après l&#039;appel de cette méthode.
 </p>
</p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-gearmanclient.setfailcallback-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <dl>
   
 <dt><code class="parameter">callback</code></dt>
 <dd>
  <p class="para">
   Une fonction ou méthode à appeler.
   Elle doit retourner une valeur valide <a href="gearman.constants.php" class="link">de retour Gearman</a>.
  </p>
  <p class="para">
   Si aucune instruction de retour n&#039;est présente, la valeur par défaut sera <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">
      La tâche pour laquelle ce callback est appelé.
     </p>
    </dd>
   
   
    <dt><code class="parameter">context</code></dt>
    <dd>
     <p class="para">
      Tout ce qui a été passé à <span class="methodname"><a href="gearmanclient.addtask.php" class="methodname">GearmanClient::addTask()</a></span> (ou méthode équivalente) en tant que <code class="parameter">context</code>.
     </p>
    </dd>
   
  </dl>
 </dd>

  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-gearmanclient.setfailcallback-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="simpara">
   Cette fonction retourne <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> en cas de succès ou <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> si une erreur survient.
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-gearmanclient.setfailcallback-seealso">
  <h3 class="title">Voir aussi</h3>
  <ul class="simplelist">
   <li><span class="methodname"><a href="gearmanclient.setdatacallback.php" class="methodname" rel="rdfs-seeAlso">GearmanClient::setDataCallback()</a> - D&eacute;finit une fonction de rappel &agrave; appeler lorsqu'un paquet de donn&eacute;es est re&ccedil;u pour une t&acirc;che</span></li>
   <li><span class="methodname"><a href="gearmanclient.setcompletecallback.php" class="methodname" rel="rdfs-seeAlso">GearmanClient::setCompleteCallback()</a> - D&eacute;finit une fonction &agrave; appeler une fois la t&acirc;che termin&eacute;e</span></li>
   <li><span class="methodname"><a href="gearmanclient.setcreatedcallback.php" class="methodname" rel="rdfs-seeAlso">GearmanClient::setCreatedCallback()</a> - D&eacute;finit une fonction de rappel &agrave; appeler lorsqu'une t&acirc;che est plac&eacute;e dans la file d'attente</span></li>
   <li><span class="methodname"><a href="gearmanclient.setexceptioncallback.php" class="methodname" rel="rdfs-seeAlso">GearmanClient::setExceptionCallback()</a> - D&eacute;finit une fonction de rappel pour les exceptions &eacute;mises par l'agent</span></li>
   <li><span class="methodname"><a href="gearmanclient.setstatuscallback.php" class="methodname" rel="rdfs-seeAlso">GearmanClient::setStatusCallback()</a> - D&eacute;finit une fonction de rappel pour collecter les statuts d'une t&acirc;che</span></li>
   <li><span class="methodname"><a href="gearmanclient.setwarningcallback.php" class="methodname" rel="rdfs-seeAlso">GearmanClient::setWarningCallback()</a> - D&eacute;finit une fonction de rappel lors de l'&eacute;mission d'alerte depuis l'agent</span></li>
   <li><span class="methodname"><a href="gearmanclient.setworkloadcallback.php" class="methodname" rel="rdfs-seeAlso">GearmanClient::setWorkloadCallback()</a> - D&eacute;finit une fonction de rappel lors de la r&eacute;ception de mises &agrave; jour de donn&eacute;es incr&eacute;mentales</span></li>
  </ul>
 </div>


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