src/Comely/IO/Cache/Cache.php
public function ping(bool $reconnect = false): bool
    {
        if ($this->engine) {
            $ping = $this->engine->ping();
            if (!$ping) {
                $this->engine = null;
                if ($reconnect) {
                    $this->connect();
                }
            }

            return $ping;
        }

        return false;
    }
public function ping(bool $reconnect = false): bool
    {
        if ($this->engine) {
            $ping = $this->engine->ping();
            if (!$ping) {
                $this->engine = null;
                if ($reconnect) {
                    $this->connect();
                }
            }

            return $ping;
        }

        return false;
    }
public function ping ( bool $ reconnect = false ) : bool { if ( $ this -> engine ) { $ ping = $ this -> engine -> ping ( ) ; if ( ! $ ping ) { $ this -> engine = null ; if ( $ reconnect ) { $ this -> connect ( ) ; } } return $ ping ; } return false ; }
Ping Cache Server

This method will not only check the connection status, but also attempt to ping cache server. On failure,
cache component will be disconnected with cache server/engine. Optional $reconnect param. may be passed to
attempt reconnection on failure.

@param bool $reconnect
@return bool
@throws ConnectionException
@throws EngineException
Ping Cache Server