MCPcopy
hub / github.com/colbymchenry/codegraph / constructor

Method constructor

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

Source from the content-addressed store, hash-verified

160 private readonly createWorker: () => PoolWorker;
161
162 constructor(opts: QueryPoolOptions) {
163 this.root = opts.root;
164 this.maxSize = Math.max(1, Math.min(opts.size ?? Math.max(1, os.cpus().length - 1), MAX_POOL_SIZE));
165 this.softTimeoutMs = opts.softTimeoutMs ?? resolveBusyTimeoutMs();
166 this.maxRetries = opts.maxRetries ?? 1;
167 this.createWorker = opts.createWorker ?? (() => new Worker(WORKER_FILE, { workerData: { root: this.root } }));
168 this.spawnOne(); // one eager warm worker, ready for the first call
169 }
170
171 /** Pool size cap (for logging/status). */
172 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