Concurrent broadcasting #1291
Replies: 2 comments 2 replies
-
I think the correct word here is "sequentially". I don't think broadcasting happens synchronously as you say. The only part that is sequential is the queuing of the events, because the actual writing to the client WebSockets happens in background tasks.
I'm not sure I understand What you are saying here. Gevent is single-threaded. |
Beta Was this translation helpful? Give feedback.
-
sorry for my bad english. For example, if we want to broadcast an event to 100 clients, can we use 100 greenlets, or use a thread pool to concurrent push to all clients instead of using one background thread to push sequentially? |
Beta Was this translation helpful? Give feedback.
-
Describe the solution you'd like
The current broadcasting mechanism is to synchronously push messages to clients one after another in a for loop. If the number of clients is very large, this will be very slow. Can we use methods like GEVENT pool to broadcast concurrently?
Beta Was this translation helpful? Give feedback.
All reactions