-
Notifications
You must be signed in to change notification settings - Fork 412
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Investigate reusing HttpClient between requests #441
Comments
This commit adds the `:http-client` parameter in the response. This is the HttpClient that was used for the request. An http client can also be passed in with `:http-client`. Note that an :http-client may only be specified when a reusable connection manager is used, otherwise an exception will be thrown. This also adds docs and naming clarification for the helpers in the `core` namespace to create regular and async http clients. Resolves #441
@dakrone do you want me to check before releasing or clojars or I can wait for release? |
@serioga if the commit looks like it will provide what you need that's good enough for me, it'll go out in the 3.9.0 release. I just released 3.8.0 though, so it may be a little bit before another release |
@dakrone architecturally it looks perfect 👍 |
Excellent, it'll be in the next release then! |
Any timeline for 3.9 release? I'd like to instrument my clj-http calls with X-Ray and I understand this feature would allow me to pass TracedHttpClient[1] to clj-http. |
Hi @aleksandersumowski I would expect a 3.9 release sometime in the next week or so, would that work for you? |
yes, that would work. thanks a lot for great work! |
Hello @dakrone Following example looks a little bit confusing about ;; You can also build your own, using clj-http's helper or manually building it:
(let [cm (conn/make-reusable-conn-manager {})
hclient (core/build-http-client {} cm "https://example.com" false)]
(client/get "http://example.com/1"
{:connection-manager cm :http-client hclient})
(client/get "http://example.com/2"
{:connection-manager cm :http-client hclient})
(client/get "http://example.com/3"
{:connection-manager cm :http-client hclient})) a. Should we really specify b. What happened if we use one conn-manager instance in |
ah, and parameter order is wrong in |
It may not need to be created every time, instead, it could be reused.
Related to #371
The text was updated successfully, but these errors were encountered: