Comments (3)
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.
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 withasyncio.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.
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)
- Cannot Send message to a single client.
- handling multiple websocket client connections HOT 4
- Enable to connect ! invalid handshake HOT 7
- recv() is slow HOT 5
- Client state is incorrect HOT 1
- Feature batch receive HOT 2
- [QUESTION] Switching from websocket-client to websockets HOT 1
- Sync version of broadcast HOT 2
- Running Scheduled Task in Websokcets Or Scaling with multiple workers HOT 1
- await websocket.recv() block the coroutine loop. HOT 1
- When using websockets as a client, how to send a pong when receiving a ping? HOT 1
- Make MAX_LINE configurable HOT 5
- When I use websocket to transmit continuous audio pcm data to the server, half of the data is lost HOT 1
- websocket over stomp received Session closed error HOT 5
- Connection breaks in between during a sustained transfer HOT 9
- When there are N channels in a group, sending a message to the group will be sent N times HOT 1
- Asking for Guidance in Writing a WebsocketHandler for the Python logging Module HOT 3
- iOS and WebSockets: 0 bytes read/no close frame received/code 1006? HOT 5
- question: intended behavior with failed auth and async for auto-reconnect HOT 29
- Clean up tests on PyPy HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from websockets.