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 gearman 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');
?>

Résultat de l'exemple ci-dessus est similaire à :

Run the following command:
gearadmin --workers

Output:
30 ::3a3a:3361:3361:3a33%976303667 - : test
add a note

User Contributed Notes 1 note

up
2
zymspy at 163 dot com
9 years ago
Example #1 is wrong
The Output is nearly like:
[no] [IP] [ID] : [function_name] [function_name] ...

Such as:
73 127.0.0.1 collect : ping_collect snmp_collect
To Top