MCPcopy Index your code
hub / github.com/nodejs/node / consumeAsyncSource

Function consumeAsyncSource

lib/internal/quic/quic.js:1461–1479  ·  view source on GitHub ↗
(handle, stream, source)

Source from the content-addressed store, hash-verified

1459}
1460
1461async function consumeAsyncSource(handle, stream, source) {
1462 handle.initStreamingSource();
1463 initStreamingBackpressure(stream);
1464 try {
1465 // Normalize to AsyncIterable<Uint8Array[]>
1466 const normalized = streamFrom(source);
1467 for await (const batch of normalized) {
1468 if (stream.destroyed) return;
1469 if (await writeBatchWithDrain(handle, stream, batch)) return;
1470 }
1471 handle.endWrite();
1472 } catch (err) {
1473 if (!stream.destroyed) {
1474 stream.destroy(err);
1475 } else {
1476 throw err;
1477 }
1478 }
1479}
1480
1481async function consumeSyncSource(handle, stream, source) {
1482 handle.initStreamingSource();

Callers 1

configureOutboundFunction · 0.85

Calls 3

writeBatchWithDrainFunction · 0.85
destroyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…