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;
    }