MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / destroy

Method destroy

src/extraction/parse-pool.ts:570–584  ·  view source on GitHub ↗

Terminate all workers and reject any outstanding parses.

()

Source from the content-addressed store, hash-verified

568
569 /** Terminate all workers and reject any outstanding parses. */
570 async destroy(): Promise<void> {
571 if (this.destroyed) return;
572 this.destroyed = true;
573 const ws = [...this.workers];
574 this.workers.clear();
575 this.pending.clear();
576 this.parseCounts.clear();
577 this.idle = [];
578 for (const job of [...this.inflight.values(), ...this.queue]) {
579 this.settle(job, undefined, new Error('parse pool destroyed'));
580 }
581 this.inflight.clear();
582 this.queue = [];
583 await Promise.all(ws.map((w) => this.terminateSettled(w)));
584 }
585}

Callers 1

indexAllMethod · 0.45

Calls 5

settleMethod · 0.95
terminateSettledMethod · 0.95
mapMethod · 0.80
allMethod · 0.65
clearMethod · 0.45

Tested by

no test coverage detected