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

Method streamCachedBody

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

Source from the content-addressed store, hash-verified

334 const bodyIterator = cachedValue.body.values()
335
336 const streamCachedBody = () => {
337 for (const chunk of bodyIterator) {
338 const full = this.#writeStream.write(chunk) === false
339 this.#handler.onResponseData?.(controller, chunk)
340 // when stream is full stop writing until we get a 'drain' event
341 if (full) {
342 break
343 }
344 }
345 }
346
347 this.#writeStream
348 .on('error', function () {

Callers

nothing calls this directly

Calls 2

onResponseDataMethod · 0.65
writeMethod · 0.45

Tested by

no test coverage detected