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

Timeout/End-user abort #16

Closed
ahutchings opened this issue Oct 17, 2014 · 4 comments
Closed

Timeout/End-user abort #16

ahutchings opened this issue Oct 17, 2014 · 4 comments

Comments

@ahutchings
Copy link

How would I implement a timeout similar to jQuery's $.ajax timeout option? The fetch standard mentions an "end-user abort", but I don't see any detail on how it would be triggered.

@ahutchings ahutchings changed the title End-user abort Timeout/End-user abort Oct 17, 2014
@dgraham
Copy link
Contributor

dgraham commented Oct 18, 2014

This is probably a question for the whatwg/fetch repository or the whatwg mailing list. I'm curious about the answer as well. It seems like timeout and abort are outside the scope of the current Fetch API standard.

@dgraham dgraham closed this as completed Oct 18, 2014
@nstepien
Copy link

For what it's worth, XHR has a timeout attribute, so it might be a good idea to propose your idea to whatwg.
https://xhr.spec.whatwg.org/#the-timeout-attribute

@adambene
Copy link

@dgraham
Hey fetch community, is there any practice or even proposal to handle timeout/end-user abort using the fetch API?

Not being able to do this there may be memory leaks and inconsistencies.

Anyway thumbs up for fetch, really cool stuff.

@ianstormtaylor
Copy link

FWIW, I've opened an issue whatwg/fetch#951 with a proposal for a timeout option that solves 90% of use cases, in case anyone's interested. I think it's super important to add to make sure calls to fetch (or res.json()) don't hang indefinitely.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants