本文整理匯總了PHP中GearmanClient::addTaskLowBackground方法的典型用法代碼示例。如果您正苦於以下問題:PHP GearmanClient::addTaskLowBackground方法的具體用法?PHP GearmanClient::addTaskLowBackground怎麽用?PHP GearmanClient::addTaskLowBackground使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類GearmanClient
的用法示例。
在下文中一共展示了GearmanClient::addTaskLowBackground方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addTaskLowBackground
public function addTaskLowBackground($function_name, $workload, &$context = null, $unique = null)
{
$function_name = $this->_processFunctionName($function_name);
return parent::addTaskLowBackground($function_name, $workload, $context, $unique);
}
示例2: _processUpload
private function _processUpload($uploader, $cid = 0)
{
$photoModel = new Models\Photo();
if ($photoModel->create($uploader, array('cid' => $cid))) {
$result['id'] = $photoModel->get_pid();
$result['md5'] = $photoModel->md5;
$result['width'] = $photoModel->width;
$result['height'] = $photoModel->height;
$result['mime'] = $photoModel->mime;
$result['is_animated'] = $photoModel->is_animated;
$imgurls = $photoModel->geturi($result['id'], 130);
$result['src'] = $imgurls[0];
$thumb = new Thumb();
$thumb->resize(NULL, $result['id'], 130);
$client = new GearmanClient();
$client->addServers(Core::config('job_servers'));
$client->addTaskLowBackground("thumbnail", serialize(array($result['id'], 320)));
$client->addTaskLowBackground("thumbnail", serialize(array($result['id'], 780)));
$client->addTaskLowBackground("thumbnail", serialize(array($result['id'], 1600)));
@$client->runTasks();
return $result;
} else {
return FALSE;
}
}