MCPcopy
hub / github.com/nodejs/undici / readableStreamClose

Function readableStreamClose

lib/web/fetch/util.js:968–978  ·  view source on GitHub ↗

* @param {ReadableStreamController } controller

(controller)

Source from the content-addressed store, hash-verified

966 * @param {ReadableStreamController<Uint8Array>} controller
967 */
968function readableStreamClose (controller) {
969 try {
970 controller.close()
971 controller.byobRequest?.respond(0)
972 } catch (err) {
973 // TODO: add comment explaining why this error occurs.
974 if (!err.message.includes('Controller is already closed') && !err.message.includes('ReadableStream is already closed')) {
975 throw err
976 }
977 }
978}
979
980/**
981 * @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes

Callers 3

httpNetworkFetchFunction · 0.85
extractBodyFunction · 0.85
#onSocketCloseMethod · 0.85

Calls 1

closeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…