(chunks, options = kEmptyObject)
| 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 |
no test coverage detected