-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
doc: make it more exact #18375
doc: make it more exact #18375
Conversation
doc/api/stream.md
Outdated
handlers, and removing all pipe destinations by calling the | ||
[`stream.unpipe()`][] method. | ||
* If there are pipe destinations, by removing all pipe destinations by | ||
calling the [`stream.unpipe()`][] method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only calling unpipe()
will make stream to paused mode. see the following example.
const { Readable, Writable } = require('stream');
const r = new Readable();
const w = new Writable();
r._read = () => {};
w._write = () => {};
r.pipe(w);
r.on('data', () => {});
r.unpipe();
console.log(r._readableState.flowing); // the output is false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quick grammar nit on this: by removing all pipe destinations by ...
the sentence should be something like:
Multiple pipe destinations may be removed by calling the [`stream.unpipe()`][] method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
doc/api/stream.md
Outdated
buffered. Once the `callback` is invoked, the stream will emit a [`'drain'`][] | ||
event. If a stream implementation is capable of processing multiple chunks of | ||
data at once, the `writable._writev()` method should be implemented. | ||
buffered. When the `callback` is invoked, the stream maybe will emit a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Emitting a 'drain' event need to meet more conditions. See the source code of writable stream.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe will
-> might
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
PR-URL: nodejs#18375 Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Landed in 3ca7935 |
PR-URL: #18375 Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
PR-URL: #18375 Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
PR-URL: #18375 Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
PR-URL: #18375 Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
PR-URL: #18375 Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
PR-URL: #18375 Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
PR-URL: nodejs#18375 Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
I made a comment on every change.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
stream