MCPcopy Create free account
hub / github.com/commandoperator/cmdop-sdk / iterate

Method iterate

node/src/transport.ts:88–103  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

86 }
87
88 async *iterate(): AsyncGenerator<Envelope> {
89 for (;;) {
90 if (this.#err) throw this.#err;
91 if (this.#q.length) {
92 yield this.#q.shift()!;
93 continue;
94 }
95 if (this.#done) return;
96 const r = await new Promise<IteratorResult<Envelope>>((res) => {
97 this.#wait = res;
98 });
99 if (this.#err) throw this.#err;
100 if (r.done) return;
101 yield r.value;
102 }
103 }
104}
105
106export class Transport {

Callers 1

envelopesMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected