-
-
Notifications
You must be signed in to change notification settings - Fork 342
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
Thoughts on attempt at trio and wsproto integration #124
Comments
Hey, this is great! Two quick thoughts before I look at the actual code:
|
|
A quick update. I think I've managed to conquer the KeyboardInterrupt problems. The main issue was that I couldn't figure out how to wrap the implicit await (for spawned tasks to finish) at the end of a nursery scope. Catching KeyboardInterrupt from the spawns wasn't helpful so I eventually decided to catch it outside the nursery and then just use a new nursery to handle shutting down all the connections in parallel. |
Closing this since I don't think it's actionable at this point. @merrellb, feel free to reopen if there's an issue you'd like us to address. :-) |
So I've taken my first stab at writing a trio integration, using wsproto (@njsmith I've seen your contributions over there so if you already have a better integration with trio do let me know :-)
https://github.com/merrellb/trio_libs
I am particularly curious about any thoughts on my cancellable scope factory (is there any easier way to shutdown a single Websocket gracefully?) as well as my socket and nursery scope management base class (hopefully I have those nested correctly). Also wasn't sure if a shutdown task (awaiting a shutdown event) is best-practice. Basically, any feedback is much appreciated :-)
One issue I am running into is KeyboardInterrupt handling and allowing a graceful shutdown. I've solved the initial issue with the socket closing prematurely (thanks for responding so quickly to my ticket) but it still seems to hang on occasion requiring a double-control-c. The eventual tracebacks are inconsistent, making it a bit hard to unravel.
My apologies if a ticket is not the best way to solicit feedback but figured some other folks would be interested in seeing an attempt at some trio code.
The text was updated successfully, but these errors were encountered: