©
本文档使用 PHP中文网手册 发布
(PECL gearman >= 0.5.0)
GearmanTask::jobHandle -- gearman_job_handle — Get the job handle
Returns the job handle for this task.
此函数没有参数。
The opaque job handle.
[#1] chris at cmbuckley dot co dot uk [2013-08-14 20:38:36]
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()); // ""