matrix-org / waterfall

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

Introduce a backpressure when sending peer messages to the conference #120

Open daniel-abramov opened 1 year ago

daniel-abramov commented 1 year ago

Currently, we use buffered channels with quite a larger buffer when we're sending messages from the peer to the conference to mutate the state of a conference. We do the same when we send incoming To-Device messages to the conference.

These queues don't seem to be very useful in most cases. It seems it's OK to let the senders block if the conference can't keep up with the messages as it would introduce a natural backpressure mechanism (i.e. it does not make sense to fill up the queue with the messages that must not even be necessary). It seems to play better with an idiomatic Go.