matrix-org / waterfall

A cascading stream forwarding unit for scalable, distributed voice and video conferencing over Matrix
Apache License 2.0
97 stars 5 forks source link

Handle conferences in parallel and clean them up properly #129

Open daniel-abramov opened 1 year ago

daniel-abramov commented 1 year ago

Currently, incoming To-Device messages are handled sequentially. We use an unbounded channel to send messages to the conference. This means that we block when we send a message to the conference until the conference reads the message. This is not very good from the scalability point of view as it means that when we have multiple conferences, the slowness of a single of them would affect handling To-Device messages for others.

Also, currently, we only listen on the done channel from the conference coupled with sending the message. This means that we'll detect that the conference is over only when we try to attempt to send a new message. That might be a bit too late, so it would be better to listen to the done channel for each conference so that we can remove the conference form the map in the router once it's over.