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

Method dispatch

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

Source from the content-addressed store, hash-verified

443 }
444
445 private dispatch(w: ParsePoolWorker, job: ParseJob): void {
446 this.inflight.set(w, job);
447 this.parseCounts.set(w, (this.parseCounts.get(w) ?? 0) + 1);
448 // Scale the timeout for large files: base + 10s per 100KB (matches the
449 // original single-worker formula so pathological-file behaviour is unchanged).
450 const timeoutMs = resolveParseBudgetMs(this.parseTimeoutMs, job.task.content.length);
451 job.budgetMs = timeoutMs;
452 job.timer = setTimeout(() => this.onTimeout(w, job, timeoutMs), timeoutMs);
453 job.timer.unref?.();
454 w.postMessage({
455 type: 'parse',
456 id: job.id,
457 filePath: job.task.filePath,
458 content: job.task.content,
459 frameworkNames: job.task.frameworkNames,
460 language: job.task.language,
461 });
462 }
463
464 /**
465 * 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.90
getMethod · 0.65
postMessageMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected