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

feat(extensions/websocket): implement websocketstream #10365

Merged
merged 77 commits into from
Aug 9, 2021

Conversation

crowlKats
Copy link
Member

@crowlKats crowlKats commented Apr 25, 2021

@ry ry requested a review from piscisaureus May 1, 2021 20:53
@bnoordhuis
Copy link
Contributor

@crowlKats Is this ready for review?

@crowlKats
Copy link
Member Author

@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

Copy link
Contributor

@bnoordhuis bnoordhuis left a 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?

cli/dts/lib.deno.unstable.d.ts Show resolved Hide resolved
extensions/websocket/02_websocketstream.js Outdated Show resolved Hide resolved
extensions/websocket/02_websocketstream.js Show resolved Hide resolved
extensions/websocket/02_websocketstream.js Outdated Show resolved Hide resolved
extensions/websocket/02_websocketstream.js Outdated Show resolved Hide resolved
extensions/websocket/02_websocketstream.js Outdated Show resolved Hide resolved
extensions/websocket/02_websocketstream.js Show resolved Hide resolved
Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl>
@crowlKats
Copy link
Member Author

I'm trying to understand your remark about leaking ops. Can you go in more detail?

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 close (or any other method to close the websocket) is called

extensions/websocket/02_websocketstream.js Outdated Show resolved Hide resolved
extensions/websocket/02_websocketstream.js Outdated Show resolved Hide resolved
extensions/websocket/02_websocketstream.js Outdated Show resolved Hide resolved
Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
@crowlKats crowlKats changed the title feat(op_crate/websocket): implement websocketstream feat(extensions/websocket): implement websocketstream May 3, 2021
@bartlomieju bartlomieju added this to the 1.13.0 milestone Jul 13, 2021
@@ -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),
Copy link
Member

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.

extensions/websocket/02_websocketstream.js Outdated Show resolved Hide resolved
extensions/websocket/02_websocketstream.js Show resolved Hide resolved
extensions/websocket/02_websocketstream.js Outdated Show resolved Hide resolved
extensions/websocket/02_websocketstream.js Outdated Show resolved Hide resolved
Copy link
Member

@bartlomieju bartlomieju left a 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

Copy link
Member

@lucacasonato lucacasonato 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 @crowlKats for seeing this through.

API is --unstable for now as spec has not yet been finalized.

@lucacasonato lucacasonato merged commit 2db381e into denoland:main Aug 9, 2021
@crowlKats crowlKats deleted the websocketstream branch August 10, 2021 01:47
@sanfusu
Copy link

sanfusu commented Jan 19, 2022

@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

Does this problem still exist? I have some problems about leaking async ops, but I'm not sure if it's related to websocket.

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

Successfully merging this pull request may close these issues.

WebSocketStream API