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

Function readNext

lib/internal/blob.js:419–438  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

417 const reader = blob[kHandle].getReader();
418 const buffers = [];
419 const readNext = () => {
420 reader.pull((status, buffer) => {
421 if (status === 0) {
422 // EOS, concat & resolve
423 // buffer should be undefined here
424 resolve(concat(buffers));
425 return;
426 } else if (status < 0) {
427 // The read could fail for many different reasons when reading
428 // from a non-memory resident blob part (e.g. file-backed blob).
429 // The error details the system error code.
430 const error = lazyDOMException('The blob could not be read', 'NotReadableError');
431 reject(error);
432 return;
433 }
434 if (buffer !== undefined)
435 buffers.push(buffer);
436 queueMicrotask(() => readNext());
437 });
438 };
439 readNext();
440 return promise;
441}

Callers 1

arrayBufferFunction · 0.85

Calls 15

concatFunction · 0.85
lazyDOMExceptionFunction · 0.85
queueMicrotaskFunction · 0.85
rejectMethod · 0.80
closeMethod · 0.65
resolveFunction · 0.50
rejectFunction · 0.50
setImmediateFunction · 0.50
pullMethod · 0.45
pushMethod · 0.45
respondMethod · 0.45
shiftMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…