From b88084a9888adaeff9771908403b705b500e8693 Mon Sep 17 00:00:00 2001 From: Patrick Tuckey Date: Fri, 12 Apr 2019 15:46:28 -0700 Subject: [PATCH] Fixes #482: async mgr "reuseable -> reusable" (#483) This addresses a naming inconsistency in conn mgr functions. --- src/clj_http/conn_mgr.clj | 7 ++++++- test/clj_http/test/conn_mgr_test.clj | 6 ++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/clj_http/conn_mgr.clj b/src/clj_http/conn_mgr.clj index ad59237a..96e9a227 100644 --- a/src/clj_http/conn_mgr.clj +++ b/src/clj_http/conn_mgr.clj @@ -385,7 +385,7 @@ [io-reactor nil registry nil nil timeout java.util.concurrent.TimeUnit/SECONDS]))) -(defn ^PoolingNHttpClientConnectionManager make-reuseable-async-conn-manager +(defn ^PoolingNHttpClientConnectionManager make-reusable-async-conn-manager "Creates a default pooling async connection manager with the specified options. Handles the same options as make-reusable-conn-manager plus :io-config which should be a map containing some of the following keys: @@ -429,6 +429,11 @@ (.setDefaultMaxPerRoute conn-man default-per-route)) conn-man)) +(defn ^PoolingNHttpClientConnectionManager make-reuseable-async-conn-manager + "Wraps correctly-spelled version - keeping for backwards compatibility." + [opts] + (make-reusable-async-conn-manager opts)) + (defmulti shutdown-manager "Shut down the given connection manager, if it is not nil" class) diff --git a/test/clj_http/test/conn_mgr_test.clj b/test/clj_http/test/conn_mgr_test.clj index 05391fcd..e8b446aa 100644 --- a/test/clj_http/test/conn_mgr_test.clj +++ b/test/clj_http/test/conn_mgr_test.clj @@ -181,8 +181,10 @@ (let [regular (conn-mgr/make-regular-conn-manager {}) regular-reusable (conn-mgr/make-reusable-conn-manager {}) async (conn-mgr/make-regular-async-conn-manager {}) - async-reusable (conn-mgr/make-reuseable-async-conn-manager {})] + async-reusable (conn-mgr/make-reusable-async-conn-manager {}) + async-reuseable (conn-mgr/make-reuseable-async-conn-manager {})] (is (false? (conn-mgr/reusable? regular))) (is (true? (conn-mgr/reusable? regular-reusable))) (is (false? (conn-mgr/reusable? async))) - (is (true? (conn-mgr/reusable? async-reusable))))) + (is (true? (conn-mgr/reusable? async-reusable))) + (is (true? (conn-mgr/reusable? async-reuseable)))))