Skip to content
Noel Welsh edited this page Dec 4, 2012 · 1 revision

Integration with Rails

There are two issues with using this client in a Rails application:

  • Making sure EventMachine is started
  • Tweaks dependent on your web server

Starting EventMachine

If you're using Thin, you don't need to start EventMachine. For other servers place a call to Myna.run.get somewhere in your configuration (e.g. config/initializes/myna.rb).

For more details on running EventMachine see this blog post:

http://www.hiringthing.com/2011/11/04/eventmachine-with-rails.html

Server Dependent Tweaks

If you're using Thin you must

  • run Thin in threaded mode. Pass the --threaded command line parameter or set threaded: true in your Thin YAML config file.
  • start Rails in threadsafe mode. In an appropriate configuration file (e.g. config/application.rb) include a call to config.threadsafe!.

Clone this wiki locally