MCPcopy
hub / github.com/CapSoftware/Cap / pull

Function pull

apps/media-server/src/lib/media-audio.ts:291–309  ·  view source on GitHub ↗
(controller)

Source from the content-addressed store, hash-verified

289 reader = originalStream.getReader();
290 },
291 async pull(controller) {
292 if (!reader || cleaned) {
293 controller.close();
294 return;
295 }
296
297 try {
298 const { done, value } = await reader.read();
299 if (done) {
300 controller.close();
301 cleanup();
302 } else {
303 controller.enqueue(value);
304 }
305 } catch (err) {
306 controller.error(err);
307 cleanup();
308 }
309 },
310 cancel() {
311 cleanup();
312 },

Callers

nothing calls this directly

Calls 3

readMethod · 0.80
enqueueMethod · 0.80
cleanupFunction · 0.70

Tested by

no test coverage detected