     (or conn/*connection-manager*
         (conn/make-regular-conn-manager req))))
 
+(defmulti ^:private  shutdown class)
+(defmethod shutdown org.apache.http.conn.HttpClientConnectionManager      [^HttpClientConnectionManager  conn-mgr] (.shutdown conn-mgr))
+(defmethod shutdown org.apache.http.nio.conn.NHttpClientConnectionManager [^NHttpClientConnectionManager conn-mgr] (.shutdown conn-mgr))
+
 (defn request
   ([req] (request req nil nil))
   ([{:keys [body conn-timeout conn-request-timeout connection-manager

           (org.apache.http.impl.nio.client HttpAsyncClientBuilder
                                            HttpAsyncClients
                                            CloseableHttpAsyncClient)
           (org.apache.http.message BasicHttpResponse)
           (java.util.concurrent ExecutionException)))


                         (respond (build-response-map resp req conn-mgr context))
                         (catch Throwable t
                           (when-not (conn/reusable? conn-mgr)
                             (shutdown conn-mgr))
                           (raise t))))
                     (cancelled [this]
                       (if-let [oncancel (:oncancel req)]
                         (oncancel))
                       (when-not (conn/reusable? conn-mgr)
                         (shutdown conn-mgr))))))))))
