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

Function pull

deps/undici/src/lib/core/util.js:655–671  ·  view source on GitHub ↗
(controller)

Source from the content-addressed store, hash-verified

653 iterator = iterable[Symbol.asyncIterator]()
654 },
655 pull (controller) {
656 return iterator.next().then(({ done, value }) => {
657 if (done) {
658 return queueMicrotask(() => {
659 controller.close()
660 controller.byobRequest?.respond(0)
661 })
662 } else {
663 const buf = Buffer.isBuffer(value) ? value : Buffer.from(value)
664 if (buf.byteLength) {
665 return controller.enqueue(new Uint8Array(buf))
666 } else {
667 return this.pull(controller)
668 }
669 }
670 })
671 },
672 cancel () {
673 return iterator.return()
674 },

Callers

nothing calls this directly

Calls 8

queueMicrotaskFunction · 0.85
nextMethod · 0.65
closeMethod · 0.65
thenMethod · 0.45
respondMethod · 0.45
fromMethod · 0.45
enqueueMethod · 0.45
pullMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…