MCPcopy Create free account
hub / github.com/Shinplex/rever / start

Function start

workers/retool.ts:258–267  ·  view source on GitHub ↗
(ctrl)

Source from the content-addressed store, hash-verified

256function streamResponse(gen: AsyncGenerator<string>, status = 200) {
257 const stream = new ReadableStream({
258 async start(ctrl) {
259 try {
260 for await (const chunk of gen) {
261 ctrl.enqueue(new TextEncoder().encode(chunk));
262 }
263 ctrl.close();
264 } catch (e) {
265 ctrl.error(e);
266 }
267 },
268 });
269 return new Response(stream, {
270 status,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected