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 set returns a representation that can be converted to jsonphp dbx 函数 escape a string so it can safely be used in an sql statementphp 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 remove worker optionsphp gearmanworker give the worker an identifier so it can be tracked when asking gearmand for the list of available workersphp imagickdraw specifies the shape to be used at the end of open subpaths when they are strokedphp 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 decimal128 returns a representation that can be converted to jsonphp mongodb bson objectid returns a representation that can be converted to jsonphp mongodb bson symbol returns a representation that can be converted to jsonphp mongodb bson undefined returns a representation that can be converted to jsonphp phar defines a list of up to 4 $ server variables that should be modified for executionphp recursiveregexiterator returns whether an iterator can be obtained for the current entryphp soapclient returns list of available soap functionsphp solrquery returns an offset into the list of constraints to be used for paginationphp 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.
关注编程学问公众号