From e2f3c96bde2f887f9341ca2eb4c19f3e47f3b933 Mon Sep 17 00:00:00 2001 From: Harshitha KP Date: Tue, 14 Jan 2020 09:46:08 -0500 Subject: [PATCH 1/2] doc: explain _writev() API 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: https://github.com/nodejs/node/issues/28408 Refs: https://github.com/nodejs/node/pull/28690 Co-authored-by: Parker Bjur --- doc/api/stream.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index 4f9f8241d38084..cb981ab7c380f5 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -1886,8 +1886,8 @@ methods only. The `writable._writev()` method may be implemented in addition or alternatively to `writable._write()` in stream implementations that are capable of processing -multiple chunks of data at once. If implemented, the method will be called with -all chunks of data currently buffered in the write queue. +multiple chunks of data at once. If implemented and if there are buffered data +from previous writes, `_writev` will be called instead of `_write`. The `writable._writev()` method is prefixed with an underscore because it is internal to the class that defines it, and should never be called directly by From ece288d3e329f7f1cf35b7cafe0772f306596b57 Mon Sep 17 00:00:00 2001 From: Harshitha KP Date: Thu, 16 Jan 2020 06:36:51 -0500 Subject: [PATCH 2/2] fixup: address review comments --- doc/api/stream.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index cb981ab7c380f5..fd54414aaa6a17 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -1886,8 +1886,8 @@ methods only. The `writable._writev()` method may be implemented in addition or alternatively to `writable._write()` in stream implementations that are capable of processing -multiple chunks of data at once. If implemented and if there are buffered data -from previous writes, `_writev` will be called instead of `_write`. +multiple chunks of data at once. If implemented and if there is buffered data +from previous writes, `_writev()` will be called instead of `_write()`. The `writable._writev()` method is prefixed with an underscore because it is internal to the class that defines it, and should never be called directly by