<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/refs.remote.other.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'book.gearman.php',
    1 => 'Gearman',
    2 => 'Gearman',
  ),
  'up' => 
  array (
    0 => 'refs.remote.other.php',
    1 => 'Other Services',
  ),
  'prev' => 
  array (
    0 => 'class.ftp-connection.php',
    1 => 'FTP\\Connection',
  ),
  'next' => 
  array (
    0 => 'gearman.setup.php',
    1 => 'Installing/Configuring',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/gearman/book.xml',
  ),
  'history' => 
  array (
  ),
  'extra_header_links' => 
  array (
    'rel' => 'alternate',
    'href' => '/manual/en/feeds/book.gearman.atom',
    'type' => 'application/atom+xml',
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="book.gearman" class="book">
 
 <h1 class="title">Gearman</h1>
 

 <div id="intro.gearman" class="preface">
  <h1 class="title">Introduction</h1>
  <p class="simpara">
   <a href="http://gearman.org" class="link external">&raquo;&nbsp;Gearman</a> is a generic application framework for farming
   out work to multiple machines or processes. It allows applications to complete tasks in parallel,
   to load balance processing, and to call functions between languages.  The framework can be
   used in a variety of applications, from high-availability web sites to the transport of database
   replication events.
  </p>
  <p class="simpara">
   This extension provides classes for writing Gearman clients and workers.
  </p>
 </div>

 




 




 




 




 




 




 




 





<ul class="chunklist chunklist_book"><li><a href="gearman.setup.php">Installing/Configuring</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="gearman.requirements.php">Requirements</a></li><li><a href="gearman.installation.php">Installation</a></li></ul></li><li><a href="gearman.constants.php">Predefined Constants</a></li><li><a href="gearman.examples.php">Examples</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="gearman.examples-reverse.php">Basic usage</a></li><li><a href="gearman.examples-reverse-bg.php">Basic Gearman client and worker, background</a></li><li><a href="gearman.examples-reverse-task.php">Basic Gearman client and worker, submitting tasks</a></li></ul></li><li><a href="class.gearmanclient.php">GearmanClient</a> — The GearmanClient class<ul class="chunklist chunklist_book chunklist_children"><li><a href="gearmanclient.addoptions.php">GearmanClient::addOptions</a> — Add client options</li><li><a href="gearmanclient.addserver.php">GearmanClient::addServer</a> — Add a job server to the client</li><li><a href="gearmanclient.addservers.php">GearmanClient::addServers</a> — Add a list of job servers to the client</li><li><a href="gearmanclient.addtask.php">GearmanClient::addTask</a> — Add a task to be run in parallel</li><li><a href="gearmanclient.addtaskbackground.php">GearmanClient::addTaskBackground</a> — Add a background task to be run in parallel</li><li><a href="gearmanclient.addtaskhigh.php">GearmanClient::addTaskHigh</a> — Add a high priority task to run in parallel</li><li><a href="gearmanclient.addtaskhighbackground.php">GearmanClient::addTaskHighBackground</a> — Add a high priority background task to be run in parallel</li><li><a href="gearmanclient.addtasklow.php">GearmanClient::addTaskLow</a> — Add a low priority task to run in parallel</li><li><a href="gearmanclient.addtasklowbackground.php">GearmanClient::addTaskLowBackground</a> — Add a low priority background task to be run in parallel</li><li><a href="gearmanclient.addtaskstatus.php">GearmanClient::addTaskStatus</a> — Add a task to get status</li><li><a href="gearmanclient.clearcallbacks.php">GearmanClient::clearCallbacks</a> — Clear all task callback functions</li><li><a href="gearmanclient.clone.php">GearmanClient::clone</a> — Create a copy of a GearmanClient object</li><li><a href="gearmanclient.construct.php">GearmanClient::__construct</a> — Create a GearmanClient instance</li><li><a href="gearmanclient.context.php">GearmanClient::context</a> — Get the application context</li><li><a href="gearmanclient.data.php">GearmanClient::data</a> — Get the application data (deprecated)</li><li><a href="gearmanclient.do.php">GearmanClient::do</a> — Run a single task and return a result [deprecated]</li><li><a href="gearmanclient.dobackground.php">GearmanClient::doBackground</a> — Run a task in the background</li><li><a href="gearmanclient.dohigh.php">GearmanClient::doHigh</a> — Run a single high priority task</li><li><a href="gearmanclient.dohighbackground.php">GearmanClient::doHighBackground</a> — Run a high priority task in the background</li><li><a href="gearmanclient.dojobhandle.php">GearmanClient::doJobHandle</a> — Get the job handle for the running task</li><li><a href="gearmanclient.dolow.php">GearmanClient::doLow</a> — Run a single low priority task</li><li><a href="gearmanclient.dolowbackground.php">GearmanClient::doLowBackground</a> — Run a low priority task in the background</li><li><a href="gearmanclient.donormal.php">GearmanClient::doNormal</a> — Run a single task and return a result</li><li><a href="gearmanclient.dostatus.php">GearmanClient::doStatus</a> — Get the status for the running task</li><li><a href="gearmanclient.echo.php">GearmanClient::echo</a> — Send data to all job servers to see if they echo it back [deprecated]</li><li><a href="gearmanclient.error.php">GearmanClient::error</a> — Returns an error string for the last error encountered</li><li><a href="gearmanclient.geterrno.php">GearmanClient::getErrno</a> — Get an errno value</li><li><a href="gearmanclient.jobstatus.php">GearmanClient::jobStatus</a> — Get the status of a background job</li><li><a href="gearmanclient.ping.php">GearmanClient::ping</a> — Send data to all job servers to see if they echo it back</li><li><a href="gearmanclient.removeoptions.php">GearmanClient::removeOptions</a> — Remove client options</li><li><a href="gearmanclient.returncode.php">GearmanClient::returnCode</a> — Get the last Gearman return code</li><li><a href="gearmanclient.runtasks.php">GearmanClient::runTasks</a> — Run a list of tasks in parallel</li><li><a href="gearmanclient.setclientcallback.php">GearmanClient::setClientCallback</a> — Callback function when there is a data packet for a task (deprecated)</li><li><a href="gearmanclient.setcompletecallback.php">GearmanClient::setCompleteCallback</a> — Set a function to be called on task completion</li><li><a href="gearmanclient.setcontext.php">GearmanClient::setContext</a> — Set application context</li><li><a href="gearmanclient.setcreatedcallback.php">GearmanClient::setCreatedCallback</a> — Set a callback for when a task is queued</li><li><a href="gearmanclient.setdata.php">GearmanClient::setData</a> — Set application data (deprecated)</li><li><a href="gearmanclient.setdatacallback.php">GearmanClient::setDataCallback</a> — Callback function when there is a data packet for a task</li><li><a href="gearmanclient.setexceptioncallback.php">GearmanClient::setExceptionCallback</a> — Set a callback for worker exceptions</li><li><a href="gearmanclient.setfailcallback.php">GearmanClient::setFailCallback</a> — Set callback for job failure</li><li><a href="gearmanclient.setoptions.php">GearmanClient::setOptions</a> — Set client options</li><li><a href="gearmanclient.setstatuscallback.php">GearmanClient::setStatusCallback</a> — Set a callback for collecting task status</li><li><a href="gearmanclient.settimeout.php">GearmanClient::setTimeout</a> — Set socket I/O activity timeout</li><li><a href="gearmanclient.setwarningcallback.php">GearmanClient::setWarningCallback</a> — Set a callback for worker warnings</li><li><a href="gearmanclient.setworkloadcallback.php">GearmanClient::setWorkloadCallback</a> — Set a callback for accepting incremental data updates</li><li><a href="gearmanclient.timeout.php">GearmanClient::timeout</a> — Get current socket I/O activity timeout value</li><li><a href="gearmanclient.wait.php">GearmanClient::wait</a> — Wait for I/O activity on all connections in a client</li></ul></li><li><a href="class.gearmanjob.php">GearmanJob</a> — The GearmanJob class<ul class="chunklist chunklist_book chunklist_children"><li><a href="gearmanjob.complete.php">GearmanJob::complete</a> — Send the result and complete status (deprecated)</li><li><a href="gearmanjob.construct.php">GearmanJob::__construct</a> — Create a GearmanJob instance</li><li><a href="gearmanjob.data.php">GearmanJob::data</a> — Send data for a running job (deprecated)</li><li><a href="gearmanjob.exception.php">GearmanJob::exception</a> — Send exception for running job (deprecated)</li><li><a href="gearmanjob.fail.php">GearmanJob::fail</a> — Send fail status (deprecated)</li><li><a href="gearmanjob.functionname.php">GearmanJob::functionName</a> — Get function name</li><li><a href="gearmanjob.handle.php">GearmanJob::handle</a> — Get the job handle</li><li><a href="gearmanjob.returncode.php">GearmanJob::returnCode</a> — Get last return code</li><li><a href="gearmanjob.sendcomplete.php">GearmanJob::sendComplete</a> — Send the result and complete status</li><li><a href="gearmanjob.senddata.php">GearmanJob::sendData</a> — Send data for a running job</li><li><a href="gearmanjob.sendexception.php">GearmanJob::sendException</a> — Send exception for running job (exception)</li><li><a href="gearmanjob.sendfail.php">GearmanJob::sendFail</a> — Send fail status</li><li><a href="gearmanjob.sendstatus.php">GearmanJob::sendStatus</a> — Send status</li><li><a href="gearmanjob.sendwarning.php">GearmanJob::sendWarning</a> — Send a warning</li><li><a href="gearmanjob.setreturn.php">GearmanJob::setReturn</a> — Set a return value</li><li><a href="gearmanjob.status.php">GearmanJob::status</a> — Send status (deprecated)</li><li><a href="gearmanjob.unique.php">GearmanJob::unique</a> — Get the unique identifier</li><li><a href="gearmanjob.warning.php">GearmanJob::warning</a> — Send a warning (deprecated)</li><li><a href="gearmanjob.workload.php">GearmanJob::workload</a> — Get workload</li><li><a href="gearmanjob.workloadsize.php">GearmanJob::workloadSize</a> — Get size of work load</li></ul></li><li><a href="class.gearmantask.php">GearmanTask</a> — The GearmanTask class<ul class="chunklist chunklist_book chunklist_children"><li><a href="gearmantask.construct.php">GearmanTask::__construct</a> — Create a GearmanTask instance</li><li><a href="gearmantask.create.php">GearmanTask::create</a> — Create a task (deprecated)</li><li><a href="gearmantask.data.php">GearmanTask::data</a> — Get data returned for a task</li><li><a href="gearmantask.datasize.php">GearmanTask::dataSize</a> — Get the size of returned data</li><li><a href="gearmantask.function.php">GearmanTask::function</a> — Get associated function name (deprecated)</li><li><a href="gearmantask.functionname.php">GearmanTask::functionName</a> — Get associated function name</li><li><a href="gearmantask.isknown.php">GearmanTask::isKnown</a> — Determine if task is known</li><li><a href="gearmantask.isrunning.php">GearmanTask::isRunning</a> — Test whether the task is currently running</li><li><a href="gearmantask.jobhandle.php">GearmanTask::jobHandle</a> — Get the job handle</li><li><a href="gearmantask.recvdata.php">GearmanTask::recvData</a> — Read work or result data into a buffer for a task</li><li><a href="gearmantask.returncode.php">GearmanTask::returnCode</a> — Get the last return code</li><li><a href="gearmantask.senddata.php">GearmanTask::sendData</a> — Send data for a task (deprecated)</li><li><a href="gearmantask.sendworkload.php">GearmanTask::sendWorkload</a> — Send data for a task</li><li><a href="gearmantask.taskdenominator.php">GearmanTask::taskDenominator</a> — Get completion percentage denominator</li><li><a href="gearmantask.tasknumerator.php">GearmanTask::taskNumerator</a> — Get completion percentage numerator</li><li><a href="gearmantask.unique.php">GearmanTask::unique</a> — Get the unique identifier for a task</li><li><a href="gearmantask.uuid.php">GearmanTask::uuid</a> — Get the unique identifier for a task (deprecated)</li></ul></li><li><a href="class.gearmanworker.php">GearmanWorker</a> — The GearmanWorker class<ul class="chunklist chunklist_book chunklist_children"><li><a href="gearmanworker.addfunction.php">GearmanWorker::addFunction</a> — Register and add callback function</li><li><a href="gearmanworker.addoptions.php">GearmanWorker::addOptions</a> — Add worker options</li><li><a href="gearmanworker.addserver.php">GearmanWorker::addServer</a> — Add a job server</li><li><a href="gearmanworker.addservers.php">GearmanWorker::addServers</a> — Add job servers</li><li><a href="gearmanworker.clone.php">GearmanWorker::clone</a> — Create a copy of the worker</li><li><a href="gearmanworker.construct.php">GearmanWorker::__construct</a> — Create a GearmanWorker instance</li><li><a href="gearmanworker.echo.php">GearmanWorker::echo</a> — Test job server response</li><li><a href="gearmanworker.error.php">GearmanWorker::error</a> — Get the last error encountered</li><li><a href="gearmanworker.geterrno.php">GearmanWorker::getErrno</a> — Get errno</li><li><a href="gearmanworker.options.php">GearmanWorker::options</a> — Get worker options</li><li><a href="gearmanworker.register.php">GearmanWorker::register</a> — Register a function with the job server</li><li><a href="gearmanworker.removeoptions.php">GearmanWorker::removeOptions</a> — Remove worker options</li><li><a href="gearmanworker.returncode.php">GearmanWorker::returnCode</a> — Get last Gearman return code</li><li><a href="gearmanworker.setid.php">GearmanWorker::setId</a> — Give the worker an identifier so it can be tracked when asking gearmand for the list of available workers</li><li><a href="gearmanworker.setoptions.php">GearmanWorker::setOptions</a> — Set worker options</li><li><a href="gearmanworker.settimeout.php">GearmanWorker::setTimeout</a> — Set socket I/O activity timeout</li><li><a href="gearmanworker.timeout.php">GearmanWorker::timeout</a> — Get socket I/O activity timeout</li><li><a href="gearmanworker.unregister.php">GearmanWorker::unregister</a> — Unregister a function name with the job servers</li><li><a href="gearmanworker.unregisterall.php">GearmanWorker::unregisterAll</a> — Unregister all function names with the job servers</li><li><a href="gearmanworker.wait.php">GearmanWorker::wait</a> — Wait for activity from one of the job servers</li><li><a href="gearmanworker.work.php">GearmanWorker::work</a> — Wait for and perform jobs</li></ul></li><li><a href="class.gearmanexception.php">GearmanException</a> — The GearmanException class</li></ul></div><?php manual_footer($setup); ?>