update page now
PHP 8.5.2 Released!

GearmanTask::jobHandle

gearman_job_handle

(PECL gearman >= 0.5.0)

GearmanTask::jobHandle -- gearman_job_handleObtém o identificador do trabalho

Descrição

public GearmanTask::jobHandle(): false|string

Retorna o identificador de trabalho desta tarefa.

Parâmetros

Esta função não possui parâmetros.

Valor Retornado

O identificador de trabalho opaco ou false se a tarefa ainda não foi criada.

Veja Também

add a note

User Contributed Notes 1 note

up
3
chris at cmbuckley dot co dot uk
12 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