-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
feat(extensions/websocket): implement websocketstream #10365
Conversation
# Conflicts: # op_crates/websocket/lib.rs
@crowlKats Is this ready for review? |
@bnoordhuis there are leaking async ops, and not sure how those can be fixed. i think it might have to do with the pull on the readable stream, but not sure. that aside, it would be ready |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments but mostly LGTM. Good set of regressions tests, too.
I'm trying to understand your remark about leaking ops. Can you go in more detail?
Co-authored-by: Ben Noordhuis <[email protected]>
Well when running the tests they fail due to leaking async ops. i have no clue what exactly the cause is, buut the only async stuff that i can see that could be causing this is the readable stream loop. i guess we somehow have to close the streams when |
Co-authored-by: Luca Casonato <[email protected]>
runtime/js/99_main.js
Outdated
@@ -339,6 +351,7 @@ delete Object.prototype.__proto__; | |||
URL: util.nonEnumerable(url.URL), | |||
URLSearchParams: util.nonEnumerable(url.URLSearchParams), | |||
WebSocket: util.nonEnumerable(webSocket.WebSocket), | |||
WebSocketStream: util.nonEnumerable(webSocket.WebSocketStream), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change this to only be registered when --unstable
is passed? I think typeof WebSocketStream === "undefined"
should be true when user does not pass --unstable
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update UNSTABLE_DENO_PROPS
in cli/diagnostics.rs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks @crowlKats for seeing this through.
API is --unstable for now as spec has not yet been finalized.
Does this problem still exist? I have some problems about leaking async ops, but I'm not sure if it's related to websocket. |
Needed for #10359.
Implements the WebSocketStream spec.
Resources:
https://docs.google.com/document/d/1La1ehXw76HP6n1uUeks-WJGFgAnpX2tCjKts7QFJ57Y/edit
https://docs.google.com/document/d/1XuxEshh5VYBYm1qRVKordTamCOsR-uGQBCYFcHXP4L0/edit
https://github.com/ricea/websocketstream-explainer
https://chromestatus.com/feature/5189728691290112
Closes #8831