


broadcast "all", data data = "broadcastResult" ActionCable. broadcast id, data end def broadcast ( data ) ActionCable. Both messages take a payload value that should be delivered to the appropriate destination.Įxample broadcast message: " stream_from id stream_from "all" end def echo ( data ) ActionCable. When the broadcast is completed a broadcast result message is returned to the sender. A broadcast is sent to all connected clients. An echo is returned to the sending client. The servers all implement an extremely simple protocol with only two messages: echo and broadcast. This shootout compares a simple websocket server implemented idiomatically in Clojure, C++, Elixir, Go, NodeJS, and Ruby. We also need to consider the ease of development. A performance benchmark alone is not enough. But what tools should be used to build a websocket server? Performance is important, but so is the development process. When a web application has a requirement for real time bidirectional communication, websockets are the natural choice. Community Ruby Elixir Phoenix Websocket Shootout: Clojure, C++, Elixir, Go, NodeJS, and Ruby
