MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / receiveType

Function receiveType

packages/server/test/connections.e2e.test.ts:164–172  ·  view source on GitHub ↗
(conn: Conn, type: string, timeoutMs: number)

Source from the content-addressed store, hash-verified

162}
163
164async function receiveType(conn: Conn, type: string, timeoutMs: number): Promise<WsFrame> {
165 const deadline = Date.now() + timeoutMs;
166 for (;;) {
167 const remaining = deadline - Date.now();
168 if (remaining <= 0) throw new Error(`no message of type ${type} within ${String(timeoutMs)}ms`);
169 const frame = await receive(conn, remaining);
170 if (frame.type === type) return frame;
171 }
172}
173
174async function waitForRegistrySize(
175 r: RunningServer,

Callers 1

Calls 2

receiveFunction · 0.70
nowMethod · 0.65

Tested by

no test coverage detected