-
Notifications
You must be signed in to change notification settings - Fork 29.1k
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
Deprecate AbortSignal on resources that are not actions #48725
Comments
Similarly for streams: const ac = new AbortController()
const stream = fs.createReadStream(/* */);
addAbortSignal(stream, ac.signal);
await doStuff();
ac.abort(); // close stream We should have: using stream = fs.createReadStream(/* */);
await doStuff(); |
cc @ronag @mcollina @atlowChemi @MoLow - I want to discuss this and:
|
I will be +1 on doing this:
|
I would be ok with deprecation without removal. I don't see much to gain by removing it (i.e. doc deprecate). Other than that, I think it's an excellent idea. |
I am +1 for this idea, but I am a little hesitant about completely removing |
As someone who was part of adding I think that most of the use cases for Having said that, I think that the JavaScript/Node community has not really embraced Therefore, I am ±0. |
I'm -1 in removing them, at least for now. |
One thing worth mentioning is that |
Sliding in from the linked Fastify issue... I'm not sure if this is the right place to add this, but I'll say that the one time I really tried to add https://twitter.com/jsumners79/status/1580168273210920962
How that affects any decision here, I don't know. But I wouldn't be surprised if it is a contribution to:
|
We currently have several APIs that support AbortSignals like:
Those APIs are resources and not actions and support
Symbol.dispose
Symbol.asyncDispose
.Since they are disposables, we should deprecate support for AbortSignal on APIs that are resources and not actions (while keeping AbortSignal on APIs that are actions (e.g. return promises)) and encourage the safe helper we added for
addAbortListener
on those updating our docs.Basically instead of:
We should encourage:
The text was updated successfully, but these errors were encountered: