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

Consider dropping read / write from streams in pro of Web Streams #640

Open
saghul opened this issue Aug 12, 2024 · 3 comments
Open

Consider dropping read / write from streams in pro of Web Streams #640

saghul opened this issue Aug 12, 2024 · 3 comments

Comments

@saghul
Copy link
Owner

saghul commented Aug 12, 2024

Currently both are implemented, with the latter being implemented on top of the former.

We are basically compatible with the WinterCG Sockets API: https://sockets-api.proposal.wintercg.org/ and I guess it may make most sense not to deviate where unnecessary?

Doing this change might involve switching the way we do things to do it "push" style with callbacks from the native side to reduce overhead.

A starting point could be to drop the "old" API while still using it internally.

UDP would need to remain as is, since it's not a stream. The only annoyance there is that currently the read/write APIs are almost symetrical but then again, they are not really simmetrical...

Oh, "file streams" like when stdio is redirected, but also when opening regular files, should also be considered. We'd use the pull mode there, since it matches the underlying API.

@saghul
Copy link
Owner Author

saghul commented Nov 2, 2024

https://wicg.github.io/direct-sockets/ also this.

@saghul
Copy link
Owner Author

saghul commented Nov 4, 2024

Google's direct-sockets API also considers UDP both in connected and un-connected mode. I guess that's the sign I was waiting for :-)

@saghul
Copy link
Owner Author

saghul commented Nov 4, 2024

Reported the mis-alignment in the proposals: wintercg/proposal-sockets-api#27 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant