private function shutdown(): void
    {
        $this->connectionPool->shutdown();

        foreach ($this->connectionHandlers as $connectionHandler) {
            $connectionHandler->shutdown();
        }

        while ($this->connectionPool->count() > 0) {
            $this->processConnectionPool();
        }

        $this->connectionPool->close();
    }