Skip to content

Commit

Permalink
docs: fix description of _writev()
Browse files Browse the repository at this point in the history
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
  • Loading branch information
parkerbjur committed Jul 15, 2019
1 parent 6c430b4 commit 53d83f0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions doc/api/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -1754,8 +1754,9 @@ methods only.

The `writable._writev()` method may be implemented in addition 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, the first chunk will be written with
`_write()`. When the initial write is complete, buffered chunks in the write queue, if available,
will be written all at once with `_writev()`.

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
Expand Down

0 comments on commit 53d83f0

Please sign in to comment.