-
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
writable stream _write and _writev #28408
Comments
This is by design. The first chunk is written with |
I’ve added the |
The documentation gave the impression that when the _writev method is used, it is used instead of _write. However, when _writev is used, _write loads the first chunk of data, then _writev loads all the remaining bufferred chunks in the write queue. The docs have been changed to reflect this behavior. Fixes: nodejs#28408
Does this still need to be worked on? If so I'd like to take it. |
This might be relevant #29639 |
@asbillings07 You might want to look at #28690 – it’s an open PR for this, where @tyof45 started working on it but that has kind of stalled out. I’d suggest waiting a short time to see if there’s any movement in that PR, and if not, you can feel free to open a new one. |
@addaleax Okay sounds good. |
the exact context of invocation of _writev API is not well known also, the choice between _write and _writev is not well known. add a description to make it explicit. Fixes: nodejs#28408 Refs: nodejs#28690 Co-authored-by: Parker Bjur <bjur.parker45@gmail.com>
The exact context of invocation of _writev API is not well known. Also, the choice between _write and _writev is not well known. Add a description to make it explicit. Fixes: #28408 Refs: #28690 Co-authored-by: Parker Bjur <bjur.parker45@gmail.com> PR-URL: #31356 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
The exact context of invocation of _writev API is not well known. Also, the choice between _write and _writev is not well known. Add a description to make it explicit. Fixes: #28408 Refs: #28690 Co-authored-by: Parker Bjur <bjur.parker45@gmail.com> PR-URL: #31356 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
The exact context of invocation of _writev API is not well known. Also, the choice between _write and _writev is not well known. Add a description to make it explicit. Fixes: #28408 Refs: #28690 Co-authored-by: Parker Bjur <bjur.parker45@gmail.com> PR-URL: #31356 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Version:
v12.4.0
orv10.15.3
Platform:
Linux 4.15.0-51-generic #55~16.04.1-Ubuntu SMP Thu May 16 09:24:37 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Subsystem: Stream Duplex, Object mode, piped into itself.
The documentation says that when I implement
_writev
method, it will receive chunks of data available in the buffer.What I actually see is that both
_write
and_writev
methods are used simultaneously.If
_write
is fast enough to process the buffer until it fills up to more than one object, then only_write
is used. Otherwise, for the first object in the buffer_write
will be used, and the rest will be sent to_writev
.Example:
Is this an expected behavior? I was assuming that when
_writev
method is implemented, it will be used exclusively.Thanks
The text was updated successfully, but these errors were encountered: