Skip to content

Timeout option collision #257

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

Closed
floatdrop opened this issue Dec 29, 2016 · 7 comments
Closed

Timeout option collision #257

floatdrop opened this issue Dec 29, 2016 · 7 comments
Labels
enhancement This change will extend Got features ✭ help wanted ✭

Comments

@floatdrop
Copy link
Contributor

Well, it should have happened. Since we passing options to http(s).request methods – we have timeout option collision.

For now we move our option out from object – 52ddf95

In future we should use timeout option from Http module instead.

@floatdrop floatdrop added this to the 7.0.0 milestone Dec 29, 2016
@alextes
Copy link
Contributor

alextes commented Apr 2, 2017

Your timed-out module currently supports a connection timeout which Node doesn't. Can you elaborate on this issue a little? Are you okay dropping it and just using the native timeout?

@sindresorhus
Copy link
Owner

@floatdrop ⬆️

@floatdrop
Copy link
Contributor Author

@alextes timeout option in Node is for connection timeout. For whole body timeout there is p-timeout and for response timeout it will take a few lines more, but we never used in production this case, so I considering it not popular.

@floatdrop
Copy link
Contributor Author

floatdrop commented May 7, 2017

On second glance – timeout option is for socket timeout in Node, but there is no option for connection timeout.

I propose add separate option connectionTimeout.

@sindresorhus
Copy link
Owner

Is it really necessary to have that distinction? When will you ever need to set the connection timeout manually? What about a "whole body timeout"? That what I would care about. A timeout for the total request.

@floatdrop
Copy link
Contributor Author

When will you ever need to set the connection timeout manually?

@sindresorhus quite often, actually. Connection timeout is very handy, when we have network outages between data-centres and need to retry request on reachable backend.

Is it really necessary to have that distinction?

They are quite different things and often confuse beginners. I'm good with setting timeout option for whole request timeout, but keep socketTimeout and connectionTimeout tuneable.

@sindresorhus
Copy link
Owner

They are quite different things and often confuse beginners. I'm good with setting timeout option for whole request timeout, but keep socketTimeout and connectionTimeout tuneable.

👍 Alright. Let's do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This change will extend Got features ✭ help wanted ✭
Projects
None yet
Development

No branches or pull requests

3 participants