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 map returns a representation that can be converted to jsonphp queue 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 mysqlnd qc 函数 returns a list of available storage handlerphp ncurses 函数 checks if terminal color definitions can be changedphp 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 gearmanworker set worker optionsphp 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 binary returns a representation that can be converted to jsonphp mongodb bson maxkey returns a representation that can be converted to jsonphp phardata returns true if the tar/zip archive can be modifiedphp soapclient returns list of available soap functionsphp solrquery returns an offset into the list of constraints to be used for paginationphp solrquery returns the list of fields that will be returned in the responsephp spoofchecker checks if given strings can be confusedphp swoole server shutdown the master server process this function can be called in worker processes.
关注编程学问公众号