Open fabiocognigni opened 6 years ago
My opinion: all this functionality should be removed, and the user should pass in the HTTP client from outside.
Don't we want to give the possibility to both pass in a custom HTTP client and also have a default value param with reasonable timeouts (ready-to-go code generated) ?
So where do you put this client that doesn't end up causing hidden internal singleton state?
Http4s HTTP client uses default config and the default setting for
requestTimeout
is currently Infinite: https://github.com/http4s/http4s/blob/master/blaze-client/src/main/scala/org/http4s/client/blaze/BlazeClientConfig.scala#L65We should override it in our generated client. A reasonable value could be
responseHeaderTimeout
+ 5 seconds.More details on the HTTP client timeouts: https://github.com/http4s/http4s/blob/master/blaze-client/src/main/scala/org/http4s/client/blaze/BlazeClientConfig.scala#L12-L19