* 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.
()
| 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. |
no test coverage detected