MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / ReadableByteStreamControllerRespondInReadableState

Function ReadableByteStreamControllerRespondInReadableState

out/cli.cjs:11572–11591  ·  view source on GitHub ↗
(controller, bytesWritten, pullIntoDescriptor)

Source from the content-addressed store, hash-verified

11570 }
11571 }
11572 function ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, pullIntoDescriptor) {
11573 ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesWritten, pullIntoDescriptor);
11574 if (pullIntoDescriptor.readerType === "none") {
11575 ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue(controller, pullIntoDescriptor);
11576 ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller);
11577 return;
11578 }
11579 if (pullIntoDescriptor.bytesFilled < pullIntoDescriptor.minimumFill) {
11580 return;
11581 }
11582 ReadableByteStreamControllerShiftPendingPullInto(controller);
11583 const remainderSize = pullIntoDescriptor.bytesFilled % pullIntoDescriptor.elementSize;
11584 if (remainderSize > 0) {
11585 const end = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled;
11586 ReadableByteStreamControllerEnqueueClonedChunkToQueue(controller, pullIntoDescriptor.buffer, end - remainderSize, remainderSize);
11587 }
11588 pullIntoDescriptor.bytesFilled -= remainderSize;
11589 ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableByteStream, pullIntoDescriptor);
11590 ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller);
11591 }
11592 function ReadableByteStreamControllerRespondInternal(controller, bytesWritten) {
11593 const firstDescriptor = controller._pendingPullIntos.peek();
11594 ReadableByteStreamControllerInvalidateBYOBRequest(controller);

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…