taoensso / sente

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

Add util for bulk server->uids push? #421

Open ptaoussanis opened 1 year ago

ptaoussanis commented 1 year ago

Currently the recommended way of broadcasting an event to multiple uids is something like this:

(doseq [uid all-uids] (chsk-send! uid [:my-app/ev {:payload some-data}]))

An inefficiency in this case is that the event message will be repeatedly serialized - once for each uid.

Instead, we could easily add a simple util that:

This would be a substitute for [#276].