Node.js Streams: When will _writev Be Invoked?

Viewed 114

The Node.js documentation makes the following comments about a Writable stream's _writev method.

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 is buffered data from previous writes, _writev() will be called instead of _write().

Emphasis mine. In what scenarios can a Node.js writable stream have buffered data from previous writes?

Is the _writev method only called after uncorking a corked stream that's had data written to it? Or are there other scenarios where a stream can have buffered date from previous writes? Bonus point if you can point to the place in the Node.js source code where it makes a decisions w/r/t to calling _write or _writev.

1 Answers
Related