MCPcopy Index your code
hub / github.com/colbymchenry/codegraph / tick

Function tick

__tests__/mcp-roots.test.ts:59–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

57 return new Promise((resolve, reject) => {
58 const started = Date.now();
59 const tick = () => {
60 const hit = messages.find(predicate);
61 if (hit) return resolve(hit);
62 if (Date.now() - started > timeoutMs) {
63 return reject(new Error(`Timed out. Messages so far: ${JSON.stringify(messages)}`));
64 }
65 setTimeout(tick, 20);
66 };
67 tick();
68 });
69}

Callers 1

waitForMessageFunction · 0.70

Calls 1

resolveFunction · 0.50

Tested by

no test coverage detected