MCPcopy Create free account
hub / github.com/nodejs/undici / streamCachedBody

Method streamCachedBody

lib/handler/cache-handler.js:350–359  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

348 const bodyIterator = cachedValue.body.values()
349
350 const streamCachedBody = () => {
351 for (const chunk of bodyIterator) {
352 const full = this.#writeStream.write(chunk) === false
353 this.#handler.onResponseData?.(controller, chunk)
354 // when stream is full stop writing until we get a 'drain' event
355 if (full) {
356 break
357 }
358 }
359 }
360
361 this.#writeStream
362 .on('error', function () {

Callers

nothing calls this directly

Calls 2

onResponseDataMethod · 0.65
writeMethod · 0.45

Tested by

no test coverage detected