Be able to create an AsyncHttpClient with a custom request timeout #3606
Labels
enhancement
Feature requests and improvements
good first issue
A tractable issue for those looking to make an initial contribution
I mentioned this briefly on Gitter and it was suggested I raise an issue.
I want to be able to create an AsyncHttpClient with a custom request timeout. At the moment I can use
AsyncHttpClient.resource[Task]()
to get thedefaultConfig
from http4sAsyncHttpClient
. I might have missed something (please tell me if I have!) but I don't think I can tweak this to give me a custom request timeout.defaultConfig
is:I tried copying and pasting this into my own code but
NoOpCookieStore
is a package-private class andthreadFactory
was recently moved to http4s internals where I can't access it.So my goal is to have one client with a 30 second timeout in use by my application (e.g. when talking to external services) but I want my acceptance test http4s client to have >30 seconds (e.g. 45 seconds) so it doesn't timeout whilst an external service being tested is timing out.
TL;DR - I just want to be able to set the request timeout for a client
Related:
@hamnis kindly pointed out that this is possible, which gives me an immediate workaround:
The text was updated successfully, but these errors were encountered: