GearmanWorker::setId

(No version information available, might only be in Git)

GearmanWorker::setIdDéfinit un identifiant au worker

Description

public GearmanWorker::setId ( string $id ) : bool

Assigne au worker un identifiant, permettant ainsi qu'il soit identifiable lorsque gearmand demande la liste des workers disponibles.

Liste de paramètres

id

Un identifiant.

Valeurs de retour

Cette fonction retourne TRUE en cas de succès ou FALSE si une erreur survient.

Exemples

Exemple #1 Exemple avec GearmanWorker::setId()

Définit un identifiant à un worker simple.

<?php
$worker
= new GearmanWorker();
$worker->setId('test');
?>

L'exemple ci-dessus va afficher quelque chose de similaire à :

Run the following command:
gearadmin --workers

Output:
30 ::3a3a:3361:3361:3a33%976303667 - : test