The GearmanWorker class
(PECL gearman >= 0.5.0)
はじめに
クラス概要
class GearmanWorker
{
/* メソッド */
public __construct()
}目次
- GearmanWorker::addFunction — Register and add callback function
- GearmanWorker::addOptions — Add worker options
- GearmanWorker::addServer — Add a job server
- GearmanWorker::addServers — Add job servers
- GearmanWorker::clone — Create a copy of the worker
- GearmanWorker::__construct — Create a GearmanWorker instance
- GearmanWorker::echo — Test job server response
- GearmanWorker::error — Get the last error encountered
- GearmanWorker::getErrno — Get errno
- GearmanWorker::options — Get worker options
- GearmanWorker::register — Register a function with the job server
- GearmanWorker::removeOptions — Remove worker options
- GearmanWorker::returnCode — Get last Gearman return code
- GearmanWorker::setId — Give the worker an identifier so it can be tracked when asking gearmand for the list of available workers
- GearmanWorker::setOptions — Set worker options
- GearmanWorker::setTimeout — Set socket I/O activity timeout
- GearmanWorker::timeout — Get socket I/O activity timeout
- GearmanWorker::unregister — Unregister a function name with the job servers
- GearmanWorker::unregisterAll — Unregister all function names with the job servers
- GearmanWorker::wait — Wait for activity from one of the job servers
- GearmanWorker::work — Wait for and perform jobs
+add a note
User Contributed Notes 2 notes
szhvoj@gmail!com ¶
2 years ago
Use systemd for managing this process:
---- 8< ---- /lib/systemd/system/gearman-worker.service
[Unit]
Description=My own gearman worker
[Service]
ExecStart=/usr/bin/php /var/www/my-worker.php
Restart=always
[Install]
WantedBy=multi-user.target
---- >8 ---- /lib/systemd/system/gearman-worker.service
systemctl daemon-reload
systemctl enable gearman-worker
systemctl start gearman-worker
spacewalker2002 at ukr dot net ¶
11 years ago
For background run use:
exec("nohup php worker.php >/dev/null 2>/dev/null &");
↑ and ↓ to navigate •
Enter to select •
Esc to close
Press Enter without
selection to search using Google