Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upwritable stream _write and _writev #28408
Comments
This comment has been minimized.
This comment has been minimized.
|
This is by design. The first chunk is written with |
This comment has been minimized.
This comment has been minimized.
|
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
This comment has been minimized.
This comment has been minimized.
|
Does this still need to be worked on? If so I'd like to take it. |
This comment has been minimized.
This comment has been minimized.
|
This might be relevant #29639 |
This comment has been minimized.
This comment has been minimized.
|
@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. |
This comment has been minimized.
This comment has been minimized.
|
@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
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>


Version:
v12.4.0orv10.15.3Platform:
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/LinuxSubsystem: Stream Duplex, Object mode, piped into itself.
The documentation says that when I implement
_writevmethod, it will receive chunks of data available in the buffer.What I actually see is that both
_writeand_writevmethods are used simultaneously.If
_writeis fast enough to process the buffer until it fills up to more than one object, then only_writeis used. Otherwise, for the first object in the buffer_writewill be used, and the rest will be sent to_writev.Example:
Is this an expected behavior? I was assuming that when
_writevmethod is implemented, it will be used exclusively.Thanks