MCPcopy Create free account
hub / github.com/nodejs/node / writev

Method writev

lib/internal/streams/iter/broadcast.js:544–558  ·  view source on GitHub ↗
(chunks, options)

Source from the content-addressed store, hash-verified

542 }
543
544 writev(chunks, options) {
545 if (!ArrayIsArray(chunks)) {
546 throw new ERR_INVALID_ARG_TYPE('chunks', 'Array', chunks);
547 }
548 // Fast path: no signal, writer open, buffer has space
549 if (this.#canUseWriteFastPath(options)) {
550 const converted = convertChunks(chunks);
551 this.#broadcast[kWrite](converted);
552 for (let i = 0; i < converted.length; i++) {
553 this.#totalBytes += TypedArrayPrototypeGetByteLength(converted[i]);
554 }
555 return kResolvedPromise;
556 }
557 return this.#writevSlow(chunks, options);
558 }
559
560 async #writevSlow(chunks, options) {
561 const signal = options?.signal;

Callers 1

pumpFunction · 0.45

Calls 3

#canUseWriteFastPathMethod · 0.95
#writevSlowMethod · 0.95
convertChunksFunction · 0.85

Tested by

no test coverage detected