GearmanWorker::setId

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

GearmanWorker::setIdGive the worker an identifier so it can be tracked when asking gearmand for the list of available workers

说明

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

Assigns the worker an identifier.

参数

id

A string identifier.

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE

范例

Example #1 GearmanWorker::setId() example

Set an identifier for a simple worker.

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

以上例程的输出类似于:

Run the following command:
gearadmin --workers

Output:
30 ::3a3a:3361:3361:3a33%976303667 - : test
相关文章
php priorityqueue returns a representation that can be converted to jsonphp stack returns a representation that can be converted to jsonphp dbx 函数 escape a string so it can safely be used in an sql statementphp eio 函数 can be to be called whenever there are pending requests that need finishingphp enchant 函数 returns a list of available dictionariesphp mysqlnd qc 函数 returns a list of available storage handlerphp win32service 函数 registers the script with the scm so that it can act as the service with the given namephp gearmanworker add worker optionsphp gearmanworker give the worker an identifier so it can be tracked when asking gearmand for the list of available workersphp imagickdraw returns the shape to be used at the end of open subpaths when they are strokedphp imagickdraw returns the shape to be used at the corners of paths when they are strokedphp mongodb bson int64 returns a representation that can be converted to jsonphp mongodb bson maxkey returns a representation that can be converted to jsonphp mongodb bson regex returns a representation that can be converted to jsonphp mongodb bson utcdatetime returns a representation that can be converted to jsonphp phardata returns true if the tar/zip archive can be modifiedphp reflectionparameter returns whether this parameter can be passed by valuephp solrquery returns the list of fields that will be returned in the responsephp swftextfield adds characters to a font that will be available within a textfieldphp swoole server shutdown the master server process this function can be called in worker processes.
关注编程学问公众号