GearmanJob
在线手册:中文 英文
PHP手册

GearmanJob::unique

(PECL gearman >= 0.5.0)

GearmanJob::uniqueGet the unique identifier

说明

public string GearmanJob::unique ( void )

Returns the unique identifiter for this job. The identifier is assigned by the client.

参数

此函数没有参数。

返回值

An opaque unique identifier.

参见


GearmanJob
在线手册:中文 英文
PHP手册
PHP手册 - N: Get the unique identifier

用户评论:

ben dot paulsen at myedu dot com (19-Dec-2011 08:56)

I think it's worth noting that this function will not return the unique id specified by a client request unless GEARMAN_WORKER_GRAB_UNIQ is specified as an option to the worker instance as follows ...

<?php
  $worker
= new GearmanWorker();
 
$worker->addServer();
 
$worker->addOptions(GEARMAN_WORKER_GRAB_UNIQ);
?>