src/Connection/Aggregate/SentinelReplication.php
protected function querySentinelForMaster(NodeConnectionInterface $sentinel, $service)
    {
        $payload = $sentinel->executeCommand(
            RawCommand::create('SENTINEL', 'get-master-addr-by-name', $service)
        );

        if ($payload === null) {
            throw new ServerException('ERR No such master with that name');
        }

        if ($payload instanceof ErrorResponseInterface) {
            $this->handleSentinelErrorResponse($sentinel, $payload);
        }

        return array(
            'host' => $payload[0],
            'port' => $payload[1],
            'alias' => 'master',
        );
    }
protected function querySentinelForMaster(NodeConnectionInterface $sentinel, $service)
    {
        $payload = $sentinel->executeCommand(
            RawCommand::create('SENTINEL', 'get-master-addr-by-name', $service)
        );

        if ($payload === null) {
            throw new ServerException('ERR No such master with that name');
        }

        if ($payload instanceof ErrorResponseInterface) {
            $this->handleSentinelErrorResponse($sentinel, $payload);
        }

        return array(
            'host' => $payload[0],
            'port' => $payload[1],
            'alias' => 'master',
        );
    }
protected function querySentinelForMaster ( NodeConnectionInterface $ sentinel , $ service ) { $ payload = $ sentinel -> executeCommand ( RawCommand :: create ( 'SENTINEL' , 'get-master-addr-by-name' , $ service ) ) ; if ( $ payload === null ) { throw new ServerException ( 'ERR No such master with that name' ) ; } if ( $ payload instanceof ErrorResponseInterface ) { $ this -> handleSentinelErrorResponse ( $ sentinel , $ payload ) ; } return array ( 'host' => $ payload [ 0 ] , 'port' => $ payload [ 1 ] , 'alias' => 'master' , ) ; }
Fetches the details for the master server from a sentinel.

@param NodeConnectionInterface $sentinel Connection to a sentinel server.
@param string                  $service  Name of the service.

@return array
Fetches the details for the master server from a sentinel .