update : 2015.11.03
php.shukuma.com

검색:
 
 
Add a job server

GearmanWorker::addServer

(PECL gearman >= 0.5.0)

GearmanWorker::addServerAdd a job server

설명

public bool GearmanWorker::addServer ([ string $host = 127.0.0.1 [, int $port = 4730 ]] )

Adds a job server to this worker. This goes into a list of servers than can be used to run jobs. No socket I/O happens here.

인수

host

잡 서버 호스트 이름.

port

잡 서버 포트.

반환값

성공 시 TRUE를, 실패 시 FALSE를 반환합니다.

예제

Example #1 Add alternate Gearman servers

<?php
$worker
= new GearmanWorker(); 
$worker->addServer("10.0.0.1"); 
$worker->addServer("10.0.0.2"7003);
?>

참고