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

Support BYOB Readers for Datagrams #487

Merged
merged 8 commits into from
May 11, 2023

Conversation

nidhijaju
Copy link
Member

@nidhijaju nidhijaju commented Mar 3, 2023

This change adds support for BYOB readers for datagrams in the spec, similar to WebTransportReceiveStreams.

Fixes #480.


Preview | Diff

@nidhijaju nidhijaju requested a review from ricea March 3, 2023 09:23
index.bs Outdated Show resolved Hide resolved
index.bs Show resolved Hide resolved
Copy link
Contributor

@ricea ricea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

index.bs Outdated Show resolved Hide resolved
@jan-ivar jan-ivar requested a review from jesup March 8, 2023 20:19
@jan-ivar
Copy link
Member

@jesup to have a look, and if everything looks good, then this is Editors can integrate.

index.bs Outdated Show resolved Hide resolved
@saschanaz
Copy link
Member

saschanaz commented Apr 3, 2023

The Streams spec says:

They should only create a new ArrayBufferView to pass to enqueue when the current BYOB request view is null, or when they have more bytes on hand than the current BYOB request view's byte length.

But we are instead throwing an exception here if the view is too small. Should it allocate a new Uint8Array? (Of course it's not a requirement to do so, I just wonder if it's better, which I kinda doubt as the caller won't notice whether their buffer is used at all)

The enqueued chunk will be split in that case, which is not what we want. 😅

index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
@nidhijaju nidhijaju force-pushed the support-byob-reader-datagrams branch from 6fd6810 to c085fbb Compare April 21, 2023 03:25
Copy link
Member

@saschanaz saschanaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
@nidhijaju
Copy link
Member Author

Hi @jesup, friendly ping but would you be able to take a look at this as well?

@jan-ivar
Copy link
Member

editors can integrate pending @jesup approves.

@jesup
Copy link
Collaborator

jesup commented May 11, 2023

LGTM

@jan-ivar jan-ivar merged commit cb131a6 into w3c:main May 11, 2023
github-actions bot added a commit that referenced this pull request May 11, 2023
SHA: cb131a6
Reason: push, by jan-ivar

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clarify whether spec supports BYOB readers for Datagrams
7 participants