You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Thoughts on attempt at trio and wsproto integration #124
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 :-)
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.
changed the title [-]Thoughts on my attempt at trio and wsproto integration[/-][+]Thoughts on attempt at trio and wsproto integration[/+]on Apr 17, 2017
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.
Activity
[-]Thoughts on my attempt at trio and wsproto integration[/-][+]Thoughts on attempt at trio and wsproto integration[/+]njsmith commentedon Apr 17, 2017
Hey, this is great! Two quick thoughts before I look at the actual code:
merrellb commentedon Apr 17, 2017
merrellb commentedon Apr 19, 2017
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.
oremanj commentedon Mar 12, 2019
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. :-)