PHP 7.4.12 Released!

GearmanTask::jobHandle

gearman_job_handle

(PECL gearman >= 0.5.0)

GearmanTask::jobHandle -- gearman_job_handleGet the job handle

説明

public GearmanTask::jobHandle ( void ) : string

Returns the job handle for this task.

パラメータ

この関数にはパラメータはありません。

返り値

The opaque job handle.

参考

add a note add a note

User Contributed Notes 1 note

up
3
chris at cmbuckley dot co dot uk
7 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()); // ""
To Top