taoensso / sente

Realtime web comms library for Clojure/Script
https://www.taoensso.com/sente
Eclipse Public License 1.0
1.73k stars 193 forks source link

Would it be ok to make server send-buffers_ read-only public? #356

Closed kaosko closed 3 years ago

kaosko commented 4 years ago

For background, I'm trying to manage latency in a system where the server pushes lots of (near) real-time data to the clients. The data quickly loses value as the latency increases. The per-client buffers will start growing if the system is not able to deliver them quickly enough. It doesn't look like there's any way to access the send-buffers from outside Sente. I'm thinking of sending some latency control messages every now and then with an expected reply so I can evaluate latency to manage the rate of sending and start dropping events per client as needed if they fall behind. It would be super helpful if I could look at the size of send-buffers (similar to connected-uids) and perhaps already take some action based on their size alone and also I wouldn't need to create my own per client channels that would essentially just duplicate the data. If this sounds reasonable, I'm happy to provide a pr to publish the buffers.

ptaoussanis commented 3 years ago

Hi Kalle, no objections so long as they're marked as an implementation detail in the relevant docstring/s. Would that work for you?