* Run one synthesis pass (by SYNTH_PASSES name) on the least-busy worker. * The worker reads the committed graph on its own connection and returns * the pass's edge list; the caller merges in canonical order. Rejects on * worker failure — the caller retries the pass on the main thread.
(passName: string)
| 374 | * worker failure — the caller retries the pass on the main thread. |
| 375 | */ |
| 376 | async runSynthPass(passName: string): Promise<SynthPassResult> { |
| 377 | if (this.failed) throw this.failed; |
| 378 | const id = this.nextId++; |
| 379 | const pw = this.workers.reduce((a, b) => (b.busy < a.busy ? b : a)); |
| 380 | pw.busy++; |
| 381 | return new Promise<SynthPassResult>((resolve, reject) => { |
| 382 | this.synthWaiters.set(id, { resolve, reject }); |
| 383 | pw.worker.postMessage({ type: 'synth', id, pass: passName }); |
| 384 | }); |
| 385 | } |
| 386 | |
| 387 | /** |
| 388 | * Ask every worker to close and reopen its read-only connection, and wait |
no test coverage detected