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

Method dispatch

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

Source from the content-addressed store, hash-verified

359 }
360
361 private dispatch(w: ParsePoolWorker, job: ParseJob): void {
362 this.inflight.set(w, job);
363 this.parseCounts.set(w, (this.parseCounts.get(w) ?? 0) + 1);
364 // Scale the timeout for large files: base + 10s per 100KB (matches the
365 // original single-worker formula so pathological-file behaviour is unchanged).
366 const timeoutMs = resolveParseBudgetMs(this.parseTimeoutMs, job.task.content.length);
367 job.budgetMs = timeoutMs;
368 job.timer = setTimeout(() => this.onTimeout(w, job, timeoutMs), timeoutMs);
369 job.timer.unref?.();
370 w.postMessage({
371 type: 'parse',
372 id: job.id,
373 filePath: job.task.filePath,
374 content: job.task.content,
375 frameworkNames: job.task.frameworkNames,
376 language: job.task.language,
377 });
378 }
379
380 /**
381 * 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