| 86 | } |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | export class Transport { |
| 91 | #child?: ChildProcessWithoutNullStreams; |
| 92 | #stdin?: Writable; |
| 93 | #pending = new Map<bigint, UnaryPending | StreamPending>(); |
| 94 | #nextId = 1n; |
| 95 | #closed = false; |
| 96 | #starting?: Promise<void>; |
| 97 | |
| 98 | constructor( |
| 99 | private readonly config: ClientConfig, |
| 100 | private readonly binaryPath: string, |
| 101 | ) {} |
| 102 | |
| 103 | /** @internal test seam */ |
| 104 | attachStreamsForTest(stdin: Writable, stdout: Readable): void { |
| 105 | this.#stdin = stdin; |
| 106 | this.#child = { stdin } as unknown as ChildProcessWithoutNullStreams; |