略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: GearmanTask::jobHandle

2024-11-13

GearmanTask::jobHandle

gearman_job_handle

(PECL gearman >= 0.5.0)

GearmanTask::jobHandle -- gearman_job_handleGet the job handle

说明

public GearmanTask::jobHandle(): string

Returns the job handle for this task.

参数

此函数没有参数。

返回值

The opaque job handle.

参见

add a noteadd a note

User Contributed Notes 1 note

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

官方地址:https://www.php.net/manual/en/gearmantask.jobhandle.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3