GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — lib: allow byob reader for 'blob.stream()' by debadree25 · Pull Request #49713 · nodejs/node Conversation
|
| // hit the flow rate of the stream (c.desiredSize). | ||
| queueMicrotask(() => { | ||
| if (c.desiredSize <= 0) { | ||
| if (c.desiredSize < 0) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Would draw attention of reviewers to this specific update it seems when we turn this into a ReadableByteStream the high water mark for bytestreams is 0 and for normal default streams is 1 hence we have to remove the equality here
see:
node/lib/internal/webstreams/readablestream.js
Lines 282 to 298 in 2ccfb23
| if (`${type}` === 'bytes') { | |
| if (size !== undefined) | |
| throw new ERR_INVALID_ARG_VALUE.RangeError('strategy.size', size); | |
| setupReadableByteStreamControllerFromSource( | |
| this, | |
| source, | |
| extractHighWaterMark(highWaterMark, 0)); | |
| } else { | |
| if (type !== undefined) | |
| throw new ERR_INVALID_ARG_VALUE('source.type', type); | |
| setupReadableStreamDefaultControllerFromSource( | |
| this, | |
| source, | |
| extractHighWaterMark(highWaterMark, 1), | |
| extractSizeAlgorithm(size)); | |
| } | |
| } |
also each byte is considered to be an element in the case of byte streams and hence the desiredSize can go below 0, I nonetheless asserted that the memory isnt overflowing in the existing tests but do take a look at them too if they look correct!
Thank You!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
cc @nodejs/whatwg-stream |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Landed in 23a3410 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Fixes: #47993 PR-URL: #49713 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
byob reader support for Blob.stream()
There was an error while loading. Please reload this page.