dakrone / clj-http

An idiomatic clojure http client wrapping the apache client. Officially supported version.
http://clojars.org/clj-http
MIT License
1.77k stars 408 forks source link

:threads is mis-named and mis-documented #633

Open Chouser opened 1 year ago

Chouser commented 1 year ago

The :threads option to make-reusable-conn-manager documentation says "Maximum number of threads that will be used for connecting"

This is used to call .setMaxTotal on org.apache.http.impl.conn.PoolingHttpClientConnectionManager (note the word "threads" is not in that method name; queue suspenseful music)

In turn, this calls this.pool.setMaxTotal

That is this setMaxTotal method, which sets this.maxTotal, which is used to compute freeCapacity here. Note this class has the documentation "Please note that this class does not maintain its own pool of execution Threads." and that freeCapacity computation is about connections not threads.

So, I believe this means that :threads should be named something like :max-connections and be documented appropriately.