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

Method dispatch

src/extraction/parse-pool.ts:470–487  ·  view source on GitHub ↗
(w: ParsePoolWorker, job: ParseJob)

Source from the content-addressed store, hash-verified

468 }
469
470 private dispatch(w: ParsePoolWorker, job: ParseJob): void {
471 this.inflight.set(w, job);
472 this.parseCounts.set(w, (this.parseCounts.get(w) ?? 0) + 1);
473 // Scale the timeout for large files: base + 10s per 100KB (matches the
474 // original single-worker formula so pathological-file behaviour is unchanged).
475 const timeoutMs = resolveParseBudgetMs(this.parseTimeoutMs, job.task.content.length);
476 job.budgetMs = timeoutMs;
477 job.timer = setTimeout(() => this.onTimeout(w, job, timeoutMs), timeoutMs);
478 job.timer.unref?.();
479 w.postMessage({
480 type: 'parse',
481 id: job.id,
482 filePath: job.task.filePath,
483 content: job.task.content,
484 frameworkNames: job.task.frameworkNames,
485 language: job.task.language,
486 });
487 }
488
489 /**
490 * The base timer fired with no result processed yet. Do NOT kill or settle:

Callers 1

drainMethod · 0.95

Calls 5

onTimeoutMethod · 0.95
resolveParseBudgetMsFunction · 0.85
getMethod · 0.65
postMessageMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected