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 directoryiterator determine if current directoryiterator item can be readphp directoryiterator determine if current directoryiterator item can be written tophp vector returns a representation that can be converted to jsonphp dbx 函数 escape a string so it can safely be used in an sql statementphp frontbase 函数 list databases available on a frontbase serverphp firebird/interbase 函数 register a callback function to be called when events are postedphp mcve 函数 returns array of strings which represents the keys that can be used for response parameters on this transactionphp win32service 函数 registers the script with the scm so that it can act as the service with the given namephp gearmanworker create a copy of the workerphp gearmanworker give the worker an identifier so it can be tracked when asking gearmand for the list of available workersphp harupage calculate the byte length of characters which can be included on one line of the specified widthphp mongodb bson dbpointer returns a representation that can be converted to jsonphp mongodb bson minkey returns a representation that can be converted to jsonphp mongodb bson regex returns a representation that can be converted to jsonphp mongodb bson timestamp returns a representation that can be converted to jsonphp mongogridfsfile returns a resource that can be used to read the stored filephp phar returns true if the phar archive can be modifiedphp recursiveiterator returns if an iterator can be created for the current entryphp swoole server shutdown the master server process this function can be called in worker processes.php zookeeper checks if the current zookeeper connection state can be recovered
关注编程学问公众号