Comments (2)
Yes, that would be nice.
As long as it doesn't exist in the library, I'd recommend against your first option.
Your second option can be implemented quite easily with a ThreadPoolExecutor that will handle the queuing and consuming for you. Given enough threads and a short enough timeout on send()
, you can guarantee that the operation will complete within a certain time frame e.g. if you have 50 connections, use 25 threads and a timeout at 5 seconds and you will finish within 10 seconds.
If you have 5000 connections you shouldn't be using the thread-based implementation in the first place :-)
from websockets.
Marking as a potential improvement.
from websockets.
Related Issues (20)
- 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 28
- Clean up tests on PyPy HOT 4
- Inconsistent raw frames when sending a custom text frame with an empty body HOT 3
- Expose list of connections as an attribute of WebSocketServer HOT 1
- Client initiated close always runs into `close_timeout` HOT 3
- Threading server should close connections on exit
- Respond with HTP 414 or 431 when exceeding security limits
- Multiple clients from localhost HOT 2
- speedups.c is missing from the 13.0 source distribution 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.