Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
An example Ruby on Rails 2.3 application that uses Ruby AMQP gem with Unicorn
Branch: master
Pull request Compare This branch is even with markiz:master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
app
config
lib
public
script
.gitignore
Gemfile
Gemfile.lock
LICENSE
README.md
Rakefile

README.md

An example Ruby on Rails 2.3 application that uses Ruby AMQP gem with Passenger

This app demonstrates how you can integrate Ruby amqp gem into a Ruby on Rails application that runs on Passenger.

Getting Started

gem install bundler

and then

bundle install

after that, launch passenger standalone (or use nginx/apache module)

bundle exec passenger start -p 3000

finally, visit http://localhost:3000/ with your browser and watch console output.

What does it do?

When application receives a request it is redirected to one of the free passenger workers. If there aren't any, passenger spawns one and gives control to it once it is loaded.

Key moment here is that you should start eventmachine reactor after the fork (if you use one of the smart* spawning methods), that's why PhusionPassenger.on_event(:starting_worker_process) is used. See config/initializers/amqp.rb for details.

License

Apache Public License 2.0.

See LICENSE file in the repository root.

Something went wrong with that request. Please try again.