GithubHelp home page GithubHelp logo

Comments (3)

aaugustin avatar aaugustin commented on September 27, 2024

asyncio.wait is The Right Way as far as I know. I'm using it in websockets: https://github.com/aaugustin/websockets/blob/43d334f4e19e2a9755c44448b47fa8ff07e9b0fb/websockets/protocol.py#L161-L168

I didn't hit the same issue as you because I'm wrapping the coroutine with asyncio.async so it's a task already and asyncio doesn't wrap it.

I'm not sure there's a better way. I would suggest asking on the python-tulip mailing list: https://groups.google.com/forum/#!forum/python-tulip

I'm subscribed to this list and I'll jump in the discussion if I have something to say. In the mean time, I'll close this ticket because this is really a general issue with asyncio and not a specific issue with websockets.

Thanks for taking the time to report it anyway!

from websockets.

donspaulding avatar donspaulding commented on September 27, 2024

Thanks Aymeric, for taking the time to explain and point me in the right direction.  I've raised the issue on python-tulip and will see how that goes.

Thanks also for your work on websockets (and Django 1.7!).  I know the work can sometimes be thankless, but I really appreciate your efforts to create elegant APIs.

😃

Don

On Tue, Nov 11, 2014 at 2:00 PM, Aymeric Augustin
[email protected] wrote:

asyncio.wait is The Right Way as far as I know. I'm using it in websockets: https://github.com/aaugustin/websockets/blob/43d334f4e19e2a9755c44448b47fa8ff07e9b0fb/websockets/protocol.py#L161-L168
I didn't hit the same issue as you because I'm wrapping the coroutine with asyncio.async so it's a task already and asyncio doesn't wrap it.
I'm not sure there's a better way. I would suggest asking on the python-tulip mailing list: https://groups.google.com/forum/#!forum/python-tulip
I'm subscribed to this list and I'll jump in the discussion if I have something to say. In the mean time, I'll close this ticket because this is really a general issue with asyncio and not a specific issue with websockets.

Thanks for taking the time to report it anyway!

Reply to this email directly or view it on GitHub:
#37 (comment)

from websockets.

aaugustin avatar aaugustin commented on September 27, 2024

For the record, Guido recommends the pattern I ended up with:
https://groups.google.com/d/msg/python-tulip/_a_578xox28/3Ku2jmH18-sJ

from websockets.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.