You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Version: v12.4.0 or v10.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:
DEBUG: Calling _write with 1
DEBUG: Calling _writev with 15
DEBUG: Calling _write with 1
DEBUG: Pushing null to readable
DEBUG: Calling _writev with 15
DEBUG: Calling _write with 1
DEBUG: Calling _writev with 2
DEBUG: Writable final
DEBUG: _writev 16, _write 16
DEBUG: Read 243, Written 243
Is this an expected behavior? I was assuming that when _writev method is implemented, it will be used exclusively.
This is by design. The first chunk is written with _write(). When the write is complete, buffered chunks, if available, will be written all at once with _writev().
@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.
Activity
lpinca commentedon Jul 10, 2019
This is by design. The first chunk is written with
_write(). When the write is complete, buffered chunks, if available, will be written all at once with_writev().addaleax commentedon Jul 10, 2019
I’ve added the
doclabel because this is indeed missing from the documentation and I think a PR to address that would make sense.docs: fix description of _writev()
asbillings07 commentedon Oct 4, 2019
Does this still need to be worked on? If so I'd like to take it.
ronag commentedon Oct 8, 2019
This might be relevant #29639
addaleax commentedon Oct 8, 2019
@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.
asbillings07 commentedon Oct 8, 2019
@addaleax Okay sounds good.
doc: explain _writev() API
doc: explain _writev() API
doc: explain _writev() API