Skip to content

Commit

Permalink
Fixes #482: async mgr "reuseable -> reusable"
Browse files Browse the repository at this point in the history
This addresses a naming inconsistency in conn mgr functions.
  • Loading branch information
Patrick Tuckey committed Apr 11, 2019
1 parent 6ee9439 commit 4af6c33
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/clj_http/conn_mgr.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 4 additions & 2 deletions test/clj_http/test/conn_mgr_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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)))))

0 comments on commit 4af6c33

Please # to comment.