doc: correct cleanup option in stream.(promises.)finished#55043
Merged
nodejs-github-bot merged 1 commit intonodejs:mainfrom Sep 25, 2024
Merged
doc: correct cleanup option in stream.(promises.)finished#55043nodejs-github-bot merged 1 commit intonodejs:mainfrom
cleanup option in stream.(promises.)finished#55043nodejs-github-bot merged 1 commit intonodejs:mainfrom
Conversation
9ca144e to
8db8ed6
Compare
8db8ed6 to
a3a8e0c
Compare
Renegade334
commented
Sep 21, 2024
Comment on lines
270
to
+275
| * `error` {boolean|undefined} | ||
| * `readable` {boolean|undefined} | ||
| * `writable` {boolean|undefined} | ||
| * `signal`: {AbortSignal|undefined} | ||
| * `signal` {AbortSignal|undefined} | ||
| * `cleanup` {boolean|undefined} If `true`, removes the listeners registered by | ||
| this function before the promise is fulfilled. **Default:** `false`. |
Member
Author
There was a problem hiding this comment.
Don't think that the convention for options parameter types is to include undefined?
Member
There was a problem hiding this comment.
IMO that's an issue for a different PR because this PR follows the same convention as the rest of the parameters.
lpinca
approved these changes
Sep 21, 2024
aymen94
approved these changes
Sep 23, 2024
aduh95
approved these changes
Sep 25, 2024
Collaborator
|
Landed in 7f48081 |
Merged
louwers
pushed a commit
to louwers/node
that referenced
this pull request
Nov 2, 2024
PR-URL: nodejs#55043 Refs: nodejs#44862 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
tpoisseau
pushed a commit
to tpoisseau/node
that referenced
this pull request
Nov 21, 2024
PR-URL: nodejs#55043 Refs: nodejs#44862 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Please check my working, but my reading of
stream.finished()andstream.promises.finished()is that:stream.finished()iseos()in internal/streams/end-of-stream, which returns a cleanup function that can be called by the user to remove the event listeners added byfinished()stream.promises.finished()isfinished()in internal/streams/end-of-stream, which accepts the boolean optionoptions.cleanup, which will call the cleanup function returned byeos()before the returned Promise is resolved or rejectedWhen
options.cleanupwas added in #44862, the documentation for it appears to have been added to the callback API function rather than the promises API function.This change moves it to the correct place, and documents the context of its usage, similar to the equivalent documentation for the callback API function.
Refs: #44862