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

Method writev

lib/internal/quic/quic.js:2211–2235  ·  view source on GitHub ↗
(chunks, options = kEmptyObject)

Source from the content-addressed store, hash-verified

2209 }
2210
2211 async function writev(chunks, options = kEmptyObject) {
2212 validateObject(options, 'options');
2213 const { signal } = options;
2214 if (signal !== undefined) {
2215 validateAbortSignal(signal, 'options.signal');
2216 signal.throwIfAborted();
2217 }
2218
2219 if (errored) throw error;
2220 if (closed || stream.#inner.state.writeEnded) {
2221 throw new ERR_INVALID_STATE('Writer is closed');
2222 }
2223
2224 // If a drain is already pending, another operation is waiting
2225 // for capacity. Under strict policy, reject immediately.
2226 // Later, if we add support for other backpressure policies,
2227 // we could instead await the existing drain before proceeding.
2228 if (drainWakeup != null) {
2229 throw new ERR_INVALID_STATE('Stream write buffer is full');
2230 }
2231
2232 if (!writevSync(chunks)) {
2233 throw new ERR_INVALID_STATE('Stream write buffer is full');
2234 }
2235 }
2236
2237 function endSync() {
2238 // Per the streams/iter spec, endSync and end follow a try-fallback

Callers 15

writevFunction · 0.45
writevGenericFunction · 0.45
testWritevFunction · 0.45
test-fs-writev.jsFile · 0.45
testWritevFunction · 0.45

Calls 3

validateAbortSignalFunction · 0.85
throwIfAbortedMethod · 0.80
writevSyncFunction · 0.50

Tested by

no test coverage detected