GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — stream: apply more stream/iter fixes, round 3 by jasnell · Pull Request #66079 · nodejs/node

stream: apply more stream/iter fixes, round 3 #66079

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.

Sign up for GitHub

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
jasnell wants to merge 8 commits into nodejs:main from jasnell:jasnell/moar-iter-streams-3

Uh oh!

There was an error while loading. Please reload this page.

Closed

stream: apply more stream/iter fixes, round 3 #66079

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit Hold shift + click to select a range
543436c
stream: make stream/iter toWritable apply backpressure
jasnell Aug 30, 2026
77dafe6
stream: correct strict pending-write behavior & cancellation
jasnell Aug 30, 2026
f578f9c
stream: make classic reads wake on return/throw/abort
jasnell Aug 30, 2026
0e1a293
stream,quic: correct stream/iter writer implementations
jasnell Aug 30, 2026
b02dcf6
doc: fixup and cleanup stream/iter docs
jasnell Aug 30, 2026
f3910f2
stream: cleanup promise uses in stream/iter
jasnell Aug 30, 2026
0b2fffe
test: avoid using promise wrapped timers
jasnell Aug 30, 2026
71c2c02
stream: fill out stream/iter test coverage
jasnell Sep 22, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
Prev Previous commit
Next Next commit
stream: correct strict pending-write behavior & cancellation
Signed-off-by: James M Snell <[email protected]>
Assisted-by: Opencode
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@jasnell
jasnell committed Sep 22, 2026
commit 77dafe6ac854eef9aa6f2c5a522a029f066cd279

There are no files selected for viewing

29 changes: 18 additions & 11 deletions 29 doc/api/stream_iter.md
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -1583,8 +1583,9 @@ added:

> Stability: 1 - Experimental

* `readable` {stream.Readable|Object} A classic Readable stream or any object
with `read()`, `on()`, and `off()` methods.
* `readable` {stream.Readable|Object} A classic Readable stream or a compatible
object with `read()`, `pipe()`, `destroy()`, `on()`, and `removeListener()`
methods.
* Returns: {AsyncIterable} whose chunks fulfill with {Uint8Array\[]}

Converts a classic Readable stream (or duck-typed equivalent) into a
Expand All @@ -1593,8 +1594,8 @@ stream/iter async iterable source that can be passed to [`from()`][],

If the object implements the [`toAsyncStreamable`][] protocol (as
`stream.Readable` does), that protocol is used. Otherwise, the function
duck-types on `read()`, `on()`, and `off()` (EventEmitter) and wraps the
stream with a batched async iterator.
duck-types on `read()`, `pipe()`, `destroy()`, `on()`, and `removeListener()`
(EventEmitter) and wraps the stream with a batched async iterator.

The result is cached per instance -- calling `fromReadable()` twice with the
same stream returns the same iterable.
Expand Down Expand Up @@ -1639,13 +1640,14 @@ added:

> Stability: 1 - Experimental

* `writable` {stream.Writable|Object} A classic Writable stream or any object
with `write()` and `on()` methods.
* `writable` {stream.Writable|Object} A classic Writable stream or a compatible
object with `write()`, `end()`, `destroy()`, `on()`, and `removeListener()`
methods.
* `options` {Object}
* `backpressure` {string} Backpressure policy. **Default:** `'strict'`.
* `'strict'` -- writes are rejected when the buffer is full. Catches
callers that ignore backpressure.
* `'unbounded'` -- writes wait for drain when the buffer is full. Recommended
* `'strict'` -- one write may wait while the buffer is full. Further writes
are rejected until it is accepted or canceled.
* `'unbounded'` -- writes are queued while the buffer is full. Recommended
for use with [`pipeTo()`][].
* `'drop-newest'` -- writes are silently discarded when the buffer is full.
* `'drop-oldest'` -- **not supported**. Throws `ERR_INVALID_ARG_VALUE`.
Expand All @@ -1657,8 +1659,9 @@ destination.

Since all writes on a classic Writable are fundamentally asynchronous,
the synchronous Writer methods (`writeSync`, `writevSync`, `endSync`) always
return `false` or `-1`, deferring to the async path. The per-write
`options.signal` parameter from the Writer interface is also ignored.
return `false` or `-1`, deferring to the async path. A queued `write()` or
`writev()` can be canceled with its `options.signal` before it reaches the
classic Writable.

If `writer.fail(reason)` receives a non-Error reason, the classic Writable is
destroyed with an `ERR_FALSY_VALUE_REJECTION` or `ERR_OPERATION_FAILED` error.
Expand Down Expand Up @@ -1817,6 +1820,10 @@ non-Error reason is wrapped in an `ERR_FALSY_VALUE_REJECTION` or
`ERR_OPERATION_FAILED` error before it is passed to the callback. The error's
`reason` property contains the original value.

Destroying the Writable before successful completion calls `writer.fail()`.
If `fail()` is unavailable, `Symbol.dispose` or `Symbol.asyncDispose` is used
when implemented by the Writer.

The Writable uses the default classic stream `highWaterMark`. Classic stream
backpressure bounds writes waiting to reach the underlying Writer, while the
Writer controls completion of the active `_write()` or `_writev()` operation.
Expand Down
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.