Skip to content

Commit

Permalink
Added warning about Thin/Rails combination to the README.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Šťastný aka Botanicus committed Jan 5, 2011
1 parent 7da133a commit 1a99333
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ In a Ruby on Rails app, probably the best place for this code is initializer
Sinatra and pure Rack applications, place it next to other configuration
code.

If you want to integrate AMQP with Thin or another EventMachine-based software which already runs an event loop, you might want to use following code:

EM.next_tick { AMQP.connect(...) }

So in case the reactor isn't running yet (which seems to be the case with Ruby on Rails 3.x and Thin combination), it won't fail, but wait when the reactor is started (see [issue #21](https://github.com/tmm1/amqp/issues/21)).

Same separate thread technique can be used to make EventMachine play nicely with other
libraries that would block current thread (like [File::Tail](http://rubygems.org/gems/file-tail)).

Expand Down

0 comments on commit 1a99333

Please sign in to comment.