How to communicate with threads in Ruby?
问题 I'm building a real time game, mostly chat based, and I need to have many of these chats running concurrently, receiving and sending data through web sockets. I have been told that instead of spawning one process per game, I should have one process with one thread per game (maybe using Event Machine). I'm using Juggernaut for the sockets part, it lets me send data to all the players in a game by using a publish/subscribe system: each player subscribes to one game. But how do I send data from