Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify ReadableStreamBYOBReader.readAtLeast(minBytes, bufferArrayBufferView) #16169

Open
brettwillis opened this issue Aug 14, 2024 · 0 comments
Assignees
Labels
content:edit Request for content edits documentation Documentation edits product:workers Related to Workers product

Comments

@brettwillis
Copy link

Existing documentation URL(s)

https://developers.cloudflare.com/workers/runtime-apis/streams/readablestreambyobreader

What changes are you suggesting?

As per the docs

Returns a promise with the next available chunk of data read into a passed-in buffer. The promise will not resolve until at least minBytes have been read.

What happens if the source stream ends with less than minBytes available? A little bit of sanity would say that it would resolve with the buffer partially filled with the available bytes, rather than rejecting, but that contradicts the absolute statement that "the promise will not resolve until at least minBytes have been read".

Docs should explain what happens in the case of the stream ending with less bytes than requested.

Additional information

No response

@brettwillis brettwillis added content:edit Request for content edits documentation Documentation edits labels Aug 14, 2024
@github-actions github-actions bot added the product:workers Related to Workers product label Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content:edit Request for content edits documentation Documentation edits product:workers Related to Workers product
Projects
None yet
Development

No branches or pull requests

2 participants