Skip to content

Commit 85226a2

Browse files
jmorrellclaude
andcommitted
Rewrite rpcSession function as RpcSession class
Uses the RpcSessionImpl + RpcSession pattern from capnweb to hide implementation details behind JS private fields (#impl). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8fa639d commit 85226a2

File tree

4 files changed

+199
-183
lines changed

4 files changed

+199
-183
lines changed

src/__tests__/fixtures/worker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Test worker for Workers runtime tests
22
import { newWorkersRpcResponse } from "../../index.js";
3-
import { rpcSession } from "../../session.js";
3+
import { RpcSession } from "../../session.js";
44
import { createWebSocketTransport } from "../../websocket.js";
55

66
// Test service shared between HTTP and WebSocket transports
@@ -39,7 +39,7 @@ export default {
3939
},
4040
};
4141

42-
const session = rpcSession(transport, biService, { role: "acceptor" });
42+
const session = new RpcSession(transport, biService, { role: "acceptor" });
4343

4444
return new Response(null, { status: 101, webSocket: client });
4545
}

0 commit comments

Comments
 (0)