MCPcopy
hub / github.com/codeaashu/claude-code / send

Method send

src/utils/mailbox.ts:33–46  ·  view source on GitHub ↗
(msg: Message)

Source from the content-addressed store, hash-verified

31 }
32
33 send(msg: Message): void {
34 this._revision++
35 const idx = this.waiters.findIndex(w => w.fn(msg))
36 if (idx !== -1) {
37 const waiter = this.waiters.splice(idx, 1)[0]
38 if (waiter) {
39 waiter.resolve(msg)
40 this.notify()
41 return
42 }
43 }
44 this.queue.push(msg)
45 this.notify()
46 }
47
48 poll(fn: (msg: Message) => boolean = () => true): Message | undefined {
49 const idx = this.queue.findIndex(fn)

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