MCPcopy Create free account
hub / github.com/denoland/std / #callIteratorNext

Method #callIteratorNext

async/mux_async_iterator.ts:79–93  ·  view source on GitHub ↗
(
    iterator: AsyncIterator<T>,
  )

Source from the content-addressed store, hash-verified

77 }
78
79 async #callIteratorNext(
80 iterator: AsyncIterator<T>,
81 ) {
82 try {
83 const { value, done } = await iterator.next();
84 if (done) {
85 --this.#iteratorCount;
86 } else {
87 this.#yields.push({ iterator, value });
88 }
89 } catch (e) {
90 this.#throws.push(e);
91 }
92 this.#signal.resolve();
93 }
94
95 /**
96 * Returns an async iterator of the stream.

Callers 2

addMethod · 0.95
iterateMethod · 0.95

Calls 2

nextMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected