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

Method constructor

src/mcp/query-pool.ts:220–231  ·  view source on GitHub ↗
(opts: QueryPoolOptions)

Source from the content-addressed store, hash-verified

218 private lastServer?: PoolWorker;
219
220 constructor(opts: QueryPoolOptions) {
221 this.root = opts.root;
222 this.maxSize = Math.max(1, Math.min(opts.size ?? Math.max(1, os.cpus().length - 1), MAX_POOL_SIZE));
223 this.softTimeoutMs = opts.softTimeoutMs ?? resolveBusyTimeoutMs();
224 this.maxRetries = opts.maxRetries ?? 1;
225 this.idleShrinkMs = Math.max(0, opts.idleShrinkMs ?? DEFAULT_IDLE_SHRINK_MS);
226 this.idleKeepBytes = opts.idleKeepBytes ?? DEFAULT_IDLE_KEEP_BYTES;
227 this.retireTimeoutMs = opts.retireTimeoutMs ?? RETIRE_TIMEOUT_MS;
228 this.createWorker = opts.createWorker ?? (() => new Worker(WORKER_FILE, { workerData: { root: this.root } }));
229 this.startSettleMs = opts.startSettleMs ?? WORKER_START_SETTLE_MS;
230 this.spawnOne(); // one eager warm worker, ready for the first call
231 }
232
233 /** Pool size cap (for logging/status). */
234 get size(): number { return this.maxSize; }

Callers

nothing calls this directly

Calls 2

spawnOneMethod · 0.95
resolveBusyTimeoutMsFunction · 0.85

Tested by

no test coverage detected