MCPcopy Create free account
hub / github.com/nodejs/node / #resolvePendingWrites

Method #resolvePendingWrites

lib/internal/streams/iter/push.js:493–507  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

491 }
492
493 #resolvePendingWrites() {
494 while (this.#pendingWrites.length > 0 &&
495 this.#slots.length < this.#highWaterMark) {
496 const pending = this.#pendingWrites.shift();
497 this.#slots.push(pending.chunks);
498 for (let i = 0; i < pending.chunks.length; i++) {
499 this.#bytesWritten += TypedArrayPrototypeGetByteLength(pending.chunks[i]);
500 }
501 pending.resolve();
502 }
503
504 if (this.#slots.length < this.#highWaterMark) {
505 this.#resolvePendingDrains(true);
506 }
507 }
508
509 #resolvePendingDrains(canWrite) {
510 const drains = this.#pendingDrains;

Callers 2

readMethod · 0.95
#resolvePendingReadsMethod · 0.95

Calls 4

#resolvePendingDrainsMethod · 0.95
shiftMethod · 0.45
pushMethod · 0.45
resolveMethod · 0.45

Tested by

no test coverage detected