Skip to content

Commit 79df0f7

Browse files
committed
doc: update addAbortSignal webstream behavior
1 parent 8242862 commit 79df0f7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

doc/api/stream.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3476,6 +3476,11 @@ readable.getReader().read().then((result) => {
34763476
<!-- YAML
34773477
added: v15.4.0
34783478
changes:
3479+
- version: REPLACEME
3480+
pr-url: https://github.com/nodejs/node/pull/62450
3481+
description: For web streams, `addAbortSignal()` now runs `cancel` steps on
3482+
`ReadableStream`, and aborts `controller.signal` and runs
3483+
`abort` steps on `WritableStream`.
34793484
- version:
34803485
- v19.7.0
34813486
- v18.16.0
@@ -3493,7 +3498,10 @@ control stream destruction using an `AbortController`.
34933498

34943499
Calling `abort` on the `AbortController` corresponding to the passed
34953500
`AbortSignal` will behave the same way as calling `.destroy(new AbortError())`
3496-
on the stream, and `controller.error(new AbortError())` for webstreams.
3501+
on a Node.js stream. For web streams, it will error the stream with an
3502+
`AbortError`. For `ReadableStream`, it will then run the stream's cancel steps.
3503+
For `WritableStream`, it will abort `controller.signal` and then run the
3504+
stream's abort steps.
34973505

34983506
```js
34993507
const fs = require('node:fs');

0 commit comments

Comments
 (0)