MCPcopy Index your code
hub / github.com/codeaashu/claude-code / receive

Method receive

src/utils/mailbox.ts:54–66  ·  view source on GitHub ↗
(fn: (msg: Message) => boolean = () => true)

Source from the content-addressed store, hash-verified

52 }
53
54 receive(fn: (msg: Message) => boolean = () => true): Promise<Message> {
55 const idx = this.queue.findIndex(fn)
56 if (idx !== -1) {
57 const msg = this.queue.splice(idx, 1)[0]
58 if (msg) {
59 this.notify()
60 return Promise.resolve(msg)
61 }
62 }
63 return new Promise<Message>(resolve => {
64 this.waiters.push({ fn, resolve })
65 })
66 }
67
68 subscribe = this.changed.subscribe
69

Callers

nothing calls this directly

Calls 4

notifyMethod · 0.95
spliceMethod · 0.80
resolveMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected