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

Method endDrained

lib/internal/streams/iter/push.js:307–314  ·  view source on GitHub ↗

* Called by the read path when the consumer has drained all data while * the writer is in the 'closing' state. Transitions to 'closed' and * resolves the pending end promise.

()

Source from the content-addressed store, hash-verified

305 * resolves the pending end promise.
306 */
307 endDrained() {
308 if (this.#writerState !== 'closing') return;
309 this.#writerState = 'closed';
310 if (this.#pendingEnd) {
311 this.#pendingEnd.resolve(this.#bytesWritten);
312 this.#pendingEnd = null;
313 }
314 }
315
316 /**
317 * Put queue into terminal error state.

Callers 2

readMethod · 0.95
#resolvePendingReadsMethod · 0.95

Calls 1

resolveMethod · 0.45

Tested by

no test coverage detected