Closed wmatson closed 4 years ago
I can probably make a PR to fix it, I just need to find the time. Things seem to work without specifying the connection-manager in addition to the http-client, is that intended or was I just lucky?
@wmatson a PR for this would be great. I'm not sure what the second part of your question refers to, can you clarify?
(let [cm (conn/make-reusable-conn-manager {})
hclient (core/build-http-client {} false cm)]
(client/get "http://example.com/1" {:http-client hclient}))
This "works", but the documentation implies that it shouldn't:
Note that in order to reuse the client a connection manager must be used.
@dakrone I looked through the source and found that it's "harmless" to not supply the connection manager as specified in my previous comment's code snippet, although it does cause an unused connection manager to be created and shutdown.
Although it's impossible to get the connection manager from the HttpClient with the non-deprecated HttpClient API, it might be possible to not create one on request
invocation if :http-client
is supplied. Would you like me to add that to this PR or create a separate issue/PR for it?
core/build-http-client
takes a boolean forcaching?
before the connection-manager and the url supplied isn't necessary.