本文整理汇总了PHP中GearmanClient::addTaskHigh方法的典型用法代码示例。如果您正苦于以下问题:PHP GearmanClient::addTaskHigh方法的具体用法?PHP GearmanClient::addTaskHigh怎么用?PHP GearmanClient::addTaskHigh使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GearmanClient
的用法示例。
在下文中一共展示了GearmanClient::addTaskHigh方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addTaskHigh
public function addTaskHigh($function_name, $workload, &$context = null, $unique = null)
{
$function_name = $this->_processFunctionName($function_name);
return parent::addTaskHigh($function_name, $workload, $context, $unique);
}
示例2: execute
/**
* Executes an asynchronous request using the driver
* method.
*
* // Execute the asynchronous request
* $driver->execute($request_async);
*
* @param Request_Async The asynchronous request to execute
* @return Request_Async
*/
public function execute(Request_Async $request_async)
{
// Assign the asynchronous request to this driver
$this->_request_async = $request_async;
// Foreach request
foreach ($request_async as $request) {
// Add the task to the job
$task = $this->_gearman_client->addTaskHigh('request_async', serialize($request), Request_Async_Gearman::$context);
$uuid = $task->unique();
$this->_requests[$uuid] = $request;
$this->_task_handles[] = $task;
$this->_complete[$uuid] = NULL;
}
// Run the tasks
$this->_gearman_client->runTasks();
// Return request async object
return $request_async;
}