-
Notifications
You must be signed in to change notification settings - Fork 106
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
Expose options for underlying http client #59
Comments
I was looking for alternatives to request package and came across this package based on the list shown at request/request#3143 Timeouts are something that I found missing when evaluating this package for my use case. |
timeout isn’t actually supported in node.js and fetch. there’s a socket timeout in node.js and AFAIK there isn’t a timeout in fetch either. however, there are numerous quality timeout libraries for promises that will work generically with |
@mikeal Ancillary libraries for handling timeouts are insufficient without The Please consider re-opening this issue or warning others about this. |
I’m going to re-open. I hadn’t entirely recalled all the issues related to “cancellable promises” and aborting generally. We may need to start returning new/special promises in order to do this properly I’m still not sure that we’ll actually add a timeout feature, but we do need proper cancellation in order for users to be able to add a working timeout. |
You probably know how to do it, but heres the implementation of a timeout anyway |
we need to make sure we provide an API that works in browers as well. this gets tricky because of how fetch needs to be aborted. |
@mikeal Not so sure if an API makes sense here, given that as far as I can tell based on this fetch would require a specific property to be present. Similar to the nodejs specific solution. And with that required probably it is cleaner to have just a timeout property that in nodejs directly gets forwarded and for browser code get's wrapped. Nevertheless as previously addressed it is an important feature, especially for the server side. |
Is there a nice way here for exposing the additional configuration options for the underlying http client, such as timeout configuration?
The text was updated successfully, but these errors were encountered: