So, this appears to be one of the most common WebSocket related problems we see around here. As long as you have a single process (daemon/morbo), everything is super simple. But then you want to scale up a little and use multiple processes or even servers (prefork/hypnotoad), suddenly passing around messages through some shared data structure doesn't work anymore.
In the past we would have told you to use Redis pub/sub, but a few releases ago PostgreSQL got something similar with LISTEN/NOTIFY. Only one problem, PostgreSQL does not handle huge numbers of concurrent connections very well, which is a little bit at odds with WebSockets. There is a solution though, every server process only uses one database connection for all of its message sending and receiving. And that's what the latest Mojo::Pg release (1.09) focuses on with its new pub/sub system. https://github.com/kraih/mojo-pg/compare/v1.08...v1.09#diff-c112bb3542e98308d12d5ecb10a67abcR2 The example WebSocket chat app (originally written by Joel) that is included with the release not only works out of the box, it also scales quite well. https://github.com/kraih/mojo-pg/blob/v1.09/examples/chat.pl I'm very happy with how it turned out, and hope you'll build some cool apps with it too. ;) -- sebastian -- You received this message because you are subscribed to the Google Groups "Mojolicious" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/mojolicious. For more options, visit https://groups.google.com/d/optout.
