Credis_Sentinel::createMasterClient PHP Method

createMasterClient() public method

Discover the master node automatically and return an instance of Credis_Client that connects to the master
public createMasterClient ( string $name ) : Credis_Client
$name string
return Credis_Client
    public function createMasterClient($name)
    {
        $master = $this->getMasterAddressByName($name);
        if (!isset($master[0]) || !isset($master[1])) {
            throw new CredisException('Master not found');
        }
        return new Credis_Client($master[0], $master[1], $this->_timeout, $this->_persistent, $this->_db, $this->_password);
    }