GearmanTask::jobHandle
gearman_job_handle
(PECL gearman >= 0.5.0)
GearmanTask::jobHandle -- gearman_job_handle — Get the job handle
参数
此函数没有参数。
返回值
The opaque job handle, or false
if the task has not yet been created.
+添加备注
用户贡献的备注 1 note
chris at cmbuckley dot co dot uk ¶
11 years ago
The job handle is not assigned until the task is received and queued by the job server, so you will need to use one of the client callbacks to access the handle:
<?php
$client->setCreatedCallback(function ($task) {
var_dump($task->jobHandle()); // "H:server:1"
});
$task = $client->addTask('function', 'workload');
var_dump($task->jobHandle()); // ""
备份地址:http://www.lvesu.com/blog/php/gearmantask.jobhandle.php