phpday 2027 - Call for Papers

GearmanJob::unique

(PECL gearman >= 0.5.0)

GearmanJob::unique — Get the unique identifier

Description

public function GearmanJob::unique(): false|string

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

Parameters

This function has no parameters.

Return Values

An opaque unique identifier, or false if the job has not yet been initialized.

See Also

User Contributed Notes 1 note

up
5
ben dot paulsen at myedu dot com
14 years ago
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);
?>
Adding new notes is disabled. Please see the links in the Found A Problem? section.
To Top