src/MysqlPool/MySQLPool.php
public static function destruct(Client $cli, string $connName)
    {
        self::go(function () use ($cli, $connName) {
            if ($cli->isConnected()) {
                $cli ->close();
            }
            $proxyConn = false;
            foreach (self::$spareConns[$connName] as $key => $conn) {
                if (spl_object_hash($conn ->client) == spl_object_hash($cli)) {
                    $proxyConn = $conn;
                    unset(self::$spareConns[$connName][$key]);
                    break;
                }
            }
            if ($proxyConn) {
                self::recycle($proxyConn, false);
            }
        });
    }
public static function destruct(Client $cli, string $connName)
    {
        self::go(function () use ($cli, $connName) {
            if ($cli->isConnected()) {
                $cli ->close();
            }
            $proxyConn = false;
            foreach (self::$spareConns[$connName] as $key => $conn) {
                if (spl_object_hash($conn ->client) == spl_object_hash($cli)) {
                    $proxyConn = $conn;
                    unset(self::$spareConns[$connName][$key]);
                    break;
                }
            }
            if ($proxyConn) {
                self::recycle($proxyConn, false);
            }
        });
    }
销毁连接。

@param Client $cli
@param string $connName