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 set returns a representation that can be converted to jsonphp dbx 函数 escape a string so it can safely be used in an sql statementphp ncurses 函数 checks if terminal color definitions can be changedphp postgresql 函数 returns an array with client protocol and server version when available php win32service 函数 registers the script with the scm so that it can act as the service with the given namephp 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 specifies the shape to be used at the corners of paths when they are strokedphp mongocursor sets whether this query can be done on a secondary deprecated php mongodb bson binary returns a representation that can be converted to jsonphp mongodb bson decimal128 returns a representation that can be converted to jsonphp mongodb bson symbol returns a representation that can be converted to jsonphp soapclient returns list of available soap functionsphp solrquery returns an offset into the list of constraints to be used for paginationphp spoofchecker checks if given strings can be confusedphp swoole mmap map a file into memory and return the stream resource which can be used by php stream operations.php swoole server used in task process for sending result to the worker process when the task is finished.php swoole server shutdown the master server process this function can be called in worker processes.
关注编程学问公众号