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

Method requestParse

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

* Parse one file on the pool. Resolves with the extraction result, or REJECTS * if the parse times out or its worker crashes — the caller records the error * and (for worker-exit/OOM/timeout rejections) re-attempts in its retry pass.

(task: ParseTask)

Source from the content-addressed store, hash-verified

308 * and (for worker-exit/OOM/timeout rejections) re-attempts in its retry pass.
309 */
310 requestParse(task: ParseTask): Promise<ExtractionResult> {
311 if (this.destroyed) return Promise.reject(new Error('Parse pool destroyed'));
312 return new Promise<ExtractionResult>((resolve, reject) => {
313 this.queue.push({ id: this.nextId++, task, resolve, reject, settled: false });
314 this.drain();
315 });
316 }
317
318 private spawnOne(): void {
319 if (this.destroyed || this.workers.size >= this.maxSize || !this.healthy) return;

Callers 2

parseFileMethod · 0.80
parse-pool.test.tsFile · 0.80

Calls 2

drainMethod · 0.95
pushMethod · 0.80

Tested by

no test coverage detected