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

Function pullAlgorithm

lib/internal/webstreams/readablestream.js:1422–1433  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1420 const startAlgorithm = nonOpStart;
1421
1422 async function pullAlgorithm() {
1423 const iterResult = await iterator.next();
1424 if (typeof iterResult !== 'object' || iterResult === null) {
1425 throw new ERR_INVALID_STATE.TypeError(
1426 'The promise returned by the iterator.next() method must fulfill with an object');
1427 }
1428 if (iterResult.done) {
1429 readableStreamDefaultControllerClose(stream[kState].controller);
1430 } else {
1431 readableStreamDefaultControllerEnqueue(stream[kState].controller, await iterResult.value);
1432 }
1433 }
1434
1435 async function cancelAlgorithm(reason) {
1436 const returnMethod = iterator.return;

Callers

nothing calls this directly

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…