src/ProcessManager.php
protected function commandRegister(array $data, ConnectionInterface $conn)
    {
        $pid = (int)$data['pid'];
        $port = (int)$data['port'];

        try {
            $slave = $this->slaves->getByPort($port);
            $slave->register($pid, $conn);
        } catch (\Exception $e) {
            $this->output->writeln(sprintf(
                '<error>Worker #%d wanted to register on master which was not expected.</error>',
                $port
            ));
            $conn->close();
            return;
        }

        if ($this->output->isVeryVerbose()) {
            $this->output->writeln(sprintf('Worker #%d registered. Waiting for application bootstrap ... ', $port));
        }

        $this->sendMessage($conn, 'bootstrap');
    }
protected function commandRegister(array $data, ConnectionInterface $conn)
    {
        $pid = (int)$data['pid'];
        $port = (int)$data['port'];

        try {
            $slave = $this->slaves->getByPort($port);
            $slave->register($pid, $conn);
        } catch (\Exception $e) {
            $this->output->writeln(sprintf(
                '<error>Worker #%d wanted to register on master which was not expected.</error>',
                $port
            ));
            $conn->close();
            return;
        }

        if ($this->output->isVeryVerbose()) {
            $this->output->writeln(sprintf('Worker #%d registered. Waiting for application bootstrap ... ', $port));
        }

        $this->sendMessage($conn, 'bootstrap');
    }
protected function commandRegister ( array $ data , ConnectionInterface $ conn ) { $ pid = ( int ) $ data [ 'pid' ] ; $ port = ( int ) $ data [ 'port' ] ; try { $ slave = $ this -> slaves -> getByPort ( $ port ) ; $ slave -> register ( $ pid , $ conn ) ; } catch ( \ Exception $ e ) { $ this -> output -> writeln ( sprintf ( '<error>Worker #%d wanted to register on master which was not expected.</error>' , $ port ) ) ; $ conn -> close ( ) ; return ; } if ( $ this -> output -> isVeryVerbose ( ) ) { $ this -> output -> writeln ( sprintf ( 'Worker #%d registered. Waiting for application bootstrap ... ' , $ port ) ) ; } $ this -> sendMessage ( $ conn , 'bootstrap' ) ; }
A slave sent a `register` command.

@param array      $data
@param ConnectionInterface $conn
A slave sent a register command .