Building Real-Time Web Applications With Cettia, Part 2

Welcome back! If you missed Part 1, check it out here!
Broadcasting Events
To send an event to multiple sockets, you could create a Set, add a socket to the set and send events iterating over the set. It should work, but socket is stateful and not serializable, which means that the caller should always check whether this socket is available each time; it’s not possible to handle this socket on the other side of the wire. Cettia resolved these issues in a functional way.

Link: https://dzone.com/articles/building-real-time-web-applications-with-cettia?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev