Skip to content

Thoughts on attempt at trio and wsproto integration #124

Closed

Description

@merrellb

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.

Activity

  1. changed the title [-]Thoughts on my attempt at trio and wsproto integration[/-] [+]Thoughts on attempt at trio and wsproto integration[/+] on Apr 17, 2017
  2. njsmith commented on Apr 17, 2017

    @njsmith
    Member

    Hey, this is great! Two quick thoughts before I look at the actual code:

  3. merrellb commented on Apr 17, 2017

    @merrellb
    Author
    • I am subscribed to the issue but totally forgot to pin my trio version. TODO requirements.txt
    • I am on the latest OSX (errr MacOs)
  4. merrellb commented on Apr 19, 2017

    @merrellb
    Author

    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.

  5. oremanj commented on Mar 12, 2019

    @oremanj
    Member

    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. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions