ruby-on-railswebsocketeventmachineem-websocket

em-websocket gem with Ruby on Rails


I started developing a web-socket based game using the em-websocket gem.

To test the application I start the server by running

$> ruby server.rb

and then I just open two browsers going directly to the html file (no web server) and start playing.

But now I want to add a web server, some database tables, an other Ruby on Rails based gems.

How an achieve communication between my web-socket server and my Ruby on Rails application? Should they run in the same server and run as a single process? Run in separate servers and communicate through AJAX?

I need to support authentication and other features like updating the database when a game is finished, etc.

Thanks in advance.


Solution

  • There is an issue created about this:

    https://github.com/igrigorik/em-websocket/issues/21