MCPcopy Index your code
hub / github.com/nodejs/node / _writev

Function _writev

lib/internal/streams/iter/classic.js:795–819  ·  view source on GitHub ↗
(entries, cb)

Source from the content-addressed store, hash-verified

793 }
794
795 function _writev(entries, cb) {
796 const chunks = [];
797 for (let i = 0; i < entries.length; i++) {
798 const { chunk, encoding } = entries[i];
799 chunks[i] = typeof chunk === 'string' ?
800 Buffer.from(chunk, encoding) : chunk;
801 }
802 if (hasWritevSync) {
803 try {
804 if (writer.writevSync(chunks)) {
805 queueMicrotask(cb);
806 return;
807 }
808 // WritevSync returned false: not accepted, fall through to async.
809 } catch (err) {
810 cb(err);
811 return;
812 }
813 }
814 try {
815 PromisePrototypeThen(writer.writev(chunks), () => cb(), cb);
816 } catch (err) {
817 cb(err);
818 }
819 }
820
821 function _final(cb) {
822 if (!hasEnd) {

Callers

nothing calls this directly

Calls 5

queueMicrotaskFunction · 0.85
cbFunction · 0.50
fromMethod · 0.45
writevSyncMethod · 0.45
writevMethod · 0.45

Tested by

no test coverage detected