MCPcopy Create free account
hub / github.com/Noumena-Network/code / constructor

Method constructor

src/remote/appServer/client.test.ts:42–52  ·  view source on GitHub ↗
(readonly ws: WebSocket)

Source from the content-addressed store, hash-verified

40 private readonly waiters: Array<(value: unknown) => void> = []
41
42 constructor(readonly ws: WebSocket) {
43 ws.on('message', data => {
44 const parsed = JSON.parse(String(data))
45 const waiter = this.waiters.shift()
46 if (waiter) {
47 waiter(parsed)
48 } else {
49 this.queued.push(parsed)
50 }
51 })
52 }
53
54 next(label = 'fake peer message'): Promise<unknown> {
55 const queued = this.queued.shift()

Callers

nothing calls this directly

Calls 1

shiftMethod · 0.80

Tested by

no test coverage detected