MCPcopy Index your code
hub / github.com/TanStack/ai / [Symbol.asyncIterator]

Method [Symbol.asyncIterator]

packages/ai-opencode/src/stream/queue.ts:45–63  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

43 }
44
45 [Symbol.asyncIterator](): AsyncIterator<T> {
46 return {
47 next: (): Promise<IteratorResult<T>> => {
48 if (this.values.length > 0) {
49 return Promise.resolve({
50 value: this.values.shift() as T,
51 done: false,
52 })
53 }
54 if (this.failed) return Promise.reject(this.error)
55 if (this.ended) {
56 return Promise.resolve({ value: undefined, done: true })
57 }
58 return new Promise((resolve, reject) => {
59 this.waiters.push({ resolve, reject })
60 })
61 },
62 }
63 }
64}

Callers

nothing calls this directly

Calls 2

resolveMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected