setDeployer() public method

public setDeployer ( Deployer $deployer ) : Deployer\Cluster\NodeInterface
$deployer Deployer\Deployer
return Deployer\Cluster\NodeInterface
Beispiel #1
0
 /**
  * @param Deployer $deployer
  * @param string $name
  * @param array $nodes
  * @param int $port
  *
  * @throws \InvalidArgumentException
  */
 public function __construct(Deployer $deployer, $name, $nodes, $port)
 {
     if (count($nodes) < 1) {
         throw new \InvalidArgumentException('You must define at least one node to deploy');
     }
     $this->name = $name;
     $this->port = $port;
     foreach ($nodes as $key => $host) {
         $nName = $name . '_' . $key;
         $node = new Node();
         $node->setDeployer($deployer)->setName($nName)->setHost($host)->setPort($port);
         $node->initialize();
         $this->nodes[] = $node;
     }
     $this->clusterBuilder = new ClusterBuilder($this->nodes);
 }