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

Method enqueue

src/utils/stream.ts:39–48  ·  view source on GitHub ↗
(value: T)

Source from the content-addressed store, hash-verified

37 }
38
39 enqueue(value: T): void {
40 if (this.readResolve) {
41 const resolve = this.readResolve
42 this.readResolve = undefined
43 this.readReject = undefined
44 resolve({ done: false, value })
45 } else {
46 this.queue.push(value)
47 }
48 }
49
50 done() {
51 this.isDone = true

Callers 4

startFunction · 0.45
pullFunction · 0.45
startFunction · 0.45

Calls 1

resolveFunction · 0.70

Tested by 1

startFunction · 0.36