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

Method destroy

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

Terminate all workers and reject any outstanding parses.

()

Source from the content-addressed store, hash-verified

543
544 /** Terminate all workers and reject any outstanding parses. */
545 async destroy(): Promise<void> {
546 if (this.destroyed) return;
547 this.destroyed = true;
548 const ws = [...this.workers];
549 this.workers.clear();
550 this.pending.clear();
551 this.parseCounts.clear();
552 this.idle = [];
553 for (const job of [...this.inflight.values(), ...this.queue]) {
554 this.settle(job, undefined, new Error('parse pool destroyed'));
555 }
556 this.inflight.clear();
557 this.queue = [];
558 await Promise.all(ws.map((w) => this.terminateSettled(w)));
559 }
560}

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