* Reader: `sizeDelimitedDecodeStream` consumes the stdout (an * `AsyncIterable `) and yields fully-assembled Envelopes, * reassembling frames split across chunk boundaries for us.
(stdout: Readable)
| 177 | } else if (envelope.kind === Envelope_Kind.DONE) { |
| 178 | this.#pending.delete(envelope.id); |
| 179 | pending.queue.push(envelope); |
| 180 | pending.queue.end(); |
| 181 | } else if (envelope.kind === Envelope_Kind.ERROR && envelope.payload.case === "error") { |
| 182 | this.#pending.delete(envelope.id); |
| 183 | pending.queue.fail(mapCoreError(envelope.payload.value)); |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | #failAll(error: Error): void { |
| 188 | const pending = this.#pending; |
| 189 | this.#pending = new Map(); |
| 190 | for (const call of pending.values()) { |
| 191 | if (call.kind === "unary") { |
| 192 | clearTimeout(call.timer); |
| 193 | call.reject(error); |
| 194 | } else { |
| 195 | call.queue.fail(error); |
| 196 | } |
| 197 | } |
no test coverage detected