Skip to content

doc: clarify fromReadable() duck-typed contract - #63682

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
trivikr:stream-iter-readable-off
Jun 15, 2026
Merged

doc: clarify fromReadable() duck-typed contract#63682
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
trivikr:stream-iter-readable-off

Conversation

@trivikr

@trivikr trivikr commented May 31, 2026

Copy link
Copy Markdown
Member

Clarify the documented duck-typed contract for stream/iter fromReadable().

The implementation removes its internal readable listener with off() during
cleanup, so duck-typed readable inputs need to provide off() in addition to
read() and on().

Source code:

stream.off('readable', next);

Document that duck-typed readable inputs must provide off() in addition
to read() and on(), matching the cleanup behavior in the implementation.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
@nodejs-github-bot nodejs-github-bot added the doc Issues and PRs related to Node.js documentation. label May 31, 2026
@trivikr
trivikr requested a review from jasnell June 7, 2026 05:31
@trivikr trivikr added author ready PRs with CI started, the required approvals, and no outstanding review comments. commit-queue PRs queued for automated landing through the Commit Queue. labels Jun 15, 2026
@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Jun 15, 2026
@nodejs-github-bot
nodejs-github-bot merged commit 6ed5783 into nodejs:main Jun 15, 2026
28 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 6ed5783

@trivikr
trivikr deleted the stream-iter-readable-off branch June 15, 2026 17:06
aduh95 pushed a commit that referenced this pull request Jun 18, 2026
Document that duck-typed readable inputs must provide off() in addition
to read() and on(), matching the cleanup behavior in the implementation.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
PR-URL: #63682
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
aduh95 pushed a commit to aduh95/node that referenced this pull request Jul 30, 2026
Document that duck-typed readable inputs must provide off() in addition
to read() and on(), matching the cleanup behavior in the implementation.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
PR-URL: nodejs#63682
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
aduh95 pushed a commit to aduh95/node that referenced this pull request Aug 3, 2026
Document that duck-typed readable inputs must provide off() in addition
to read() and on(), matching the cleanup behavior in the implementation.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
PR-URL: nodejs#63682
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
aduh95 pushed a commit that referenced this pull request Aug 6, 2026
Document that duck-typed readable inputs must provide off() in addition
to read() and on(), matching the cleanup behavior in the implementation.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
PR-URL: #63682
Backport-PR-URL: #64675
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. doc Issues and PRs related to Node.js documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants