MCPcopy Index your code
hub / github.com/middleapi/orpc / push

Method push

packages/shared/src/queue.ts:33–55  ·  view source on GitHub ↗
(id: string, item: T)

Source from the content-addressed store, hash-verified

31 }
32
33 push(id: string, item: T): void {
34 this.assertOpen(id)
35
36 const pending = this.waiters.get(id)
37
38 if (pending?.length) {
39 pending.shift()![0](item)
40
41 if (pending.length === 0) {
42 this.waiters.delete(id)
43 }
44 }
45 else {
46 const items = this.queues.get(id)
47
48 if (items) {
49 items.push(item)
50 }
51 else {
52 this.queues.set(id, [item])
53 }
54 }
55 }
56
57 async pull(id: string): Promise<T> {
58 this.assertOpen(id)

Callers 15

replicateAsyncIteratorFunction · 0.95
serializeMethod · 0.80
rpc-link.test.tsFile · 0.80
initMethod · 0.80
initMethod · 0.80
#enqueueRequestMethod · 0.80
initMethod · 0.80
initMethod · 0.80
#enqueueMethod · 0.80
#dequeueMethod · 0.80
initMethod · 0.80
toStandardHeadersFunction · 0.80

Calls 4

assertOpenMethod · 0.95
setMethod · 0.80
getMethod · 0.65
deleteMethod · 0.65

Tested by 9

writeFunction · 0.64
subscribeListenerMethod · 0.64
createTestingPublisherFunction · 0.64
createTestingPublisherFunction · 0.64
pingMethod · 0.64
initFunction · 0.64
createMockStubFunction · 0.64
writeFunction · 0.64
initFunction · 0.64