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

Function behavior

__tests__/query-pool.test.ts:92–99  ·  view source on GitHub ↗
(m: CallMsg)

Source from the content-addressed store, hash-verified

90 // Each call holds in-flight until the gate opens, so max concurrency across
91 // the pool is observable: with size=5 and 5 calls, all 5 should run at once.
92 const behavior = (m: CallMsg): Action => ({
93 wait: (async () => {
94 active++; maxActive = Math.max(maxActive, active);
95 await gate;
96 active--;
97 return ok(`r${m.id}`);
98 })(),
99 });
100 const pool = new QueryPool({ root: '/x', size: 5, createWorker: () => new FakeWorker(behavior) });
101 const calls = Promise.all(Array.from({ length: 5 }, (_, i) => pool.run('codegraph_search', { i })));
102 await sleep(40); // let all workers spawn (cold-start cap → a few generations) + dispatch

Callers

nothing calls this directly

Calls 1

okFunction · 0.85

Tested by

no test coverage detected