Predis\Client::isConnected PHP Method

isConnected() public method

Returns the current state of the underlying connection.
public isConnected ( ) : boolean
return boolean
    public function isConnected()
    {
        return $this->connection->isConnected();
    }

Usage Example

Example #1
0
 /**
  * Creates a connect to Redis or Sentinel using the Predis\Client object.  It proxies the connecting and converts
  * specific client exceptions to more generic adapted ones in PSRedis
  *
  * @throws \PSRedis\Exception\ConnectionError
  */
 public function connect()
 {
     try {
         $this->predisClient = $this->predisClientFactory->createClient($this->clientType, $this->getPredisClientParameters());
         $this->predisClient->connect();
         $this->isConnected = $this->predisClient->isConnected();
     } catch (ConnectionException $e) {
         throw new ConnectionError($e->getMessage());
     }
 }
All Usage Examples Of Predis\Client::isConnected