MCPcopy
hub / github.com/claude-code-best/claude-code / next

Method next

src/utils/stream.ts:19–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17 }
18
19 next(): Promise<IteratorResult<T, unknown>> {
20 if (this.queue.length > 0) {
21 return Promise.resolve({
22 done: false,
23 value: this.queue.shift()!,
24 })
25 }
26 if (this.isDone) {
27 return Promise.resolve({ done: true, value: undefined })
28 }
29 if (this.hasError) {
30 return Promise.reject(this.hasError)
31 }
32 return new Promise<IteratorResult<T>>((resolve, reject) => {
33 this.readResolve = resolve
34 this.readReject = reject
35 })
36 }
37
38 enqueue(value: T): void {
39 if (this.readResolve) {

Callers 15

evictCacheIfNeededMethod · 0.80
firstGraphemeFunction · 0.80
cachedHljsAstFunction · 0.80
callFunction · 0.80
consumeBudgetFunction · 0.80
callFunction · 0.80
callFunction · 0.80
evictOldestIfAtCapFunction · 0.80
normalizeMessageFunction · 0.80
shouldShowCacheWarningFunction · 0.80

Calls 3

shiftMethod · 0.80
rejectMethod · 0.80
resolveMethod · 0.45

Tested by

no test coverage detected