Gearman is a distributed processing framework that allows work to be distributed to multiple machines and workers. The document discusses setting up Gearman and using it to distribute tasks like image resizing. It explains how to create Gearman workers to handle tasks, create clients to submit tasks, and get status updates on task processing. It also covers error handling, managing workers, and scaling the system by adding more workers.
23. namespace Cxo;
class Image
{
public function resize(GearmanJob $job)
{
$tmpFile = $job->workload();
// Resizing takes place here
...
return $finalFileName;
}
}
24. namespace Cxo;
class Image
{
public function resize(GearmanJob $job)
{
$tmpFile = $job->workload();
// Resizing takes place here
...
return $finalFileName;
}
}
25. namespace Cxo;
class Image
{
public function resize(GearmanJob $job)
{
$tmpFile = $job->workload();
// Resizing takes place here
...
return $finalFileName;
}
}
26. namespace Cxo;
class Image
{
public function resize(GearmanJob $job)
{
$tmpFile = $job->workload();
// Resizing takes place here
...
return $finalFileName;
}
}