()
| 81 | } |
| 82 | |
| 83 | #processHandlerQueue() { |
| 84 | while (this.#handlerQueue.length > 0) { |
| 85 | const handler = ArrayPrototypeShift(this.#handlerQueue); |
| 86 | const { handle, path } = handler; |
| 87 | |
| 88 | const result = handle.read( |
| 89 | this.#options.encoding, |
| 90 | this.#options.bufferSize, |
| 91 | ); |
| 92 | |
| 93 | if (result !== null) { |
| 94 | this.#processReadResult(path, result); |
| 95 | if (result.length > 0) { |
| 96 | ArrayPrototypePush(this.#handlerQueue, handler); |
| 97 | } |
| 98 | } else { |
| 99 | handle.close(); |
| 100 | } |
| 101 | |
| 102 | if (this.#bufferedEntries.length > 0) { |
| 103 | break; |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | return this.#bufferedEntries.length > 0; |
| 108 | } |
| 109 | |
| 110 | read(callback) { |
| 111 | return arguments.length === 0 ? this.#readPromisified() : this.#readImpl(true, callback); |
no test coverage detected