Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Http4s client: custom default timeouts #276

Open
fabiocognigni opened this issue Nov 6, 2017 · 3 comments
Open

Http4s client: custom default timeouts #276

fabiocognigni opened this issue Nov 6, 2017 · 3 comments

Comments

@fabiocognigni
Copy link
Contributor

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#L65

We 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

@fiadliel
Copy link
Contributor

My opinion: all this functionality should be removed, and the user should pass in the HTTP client from outside.

@fabiocognigni
Copy link
Contributor Author

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) ?

@fiadliel
Copy link
Contributor

So where do you put this client that doesn't end up causing hidden internal singleton state?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants