public
Description: Bridge code to allow AMQP (a RabbitMQ client) to be used transparently from Async-Observer
Homepage:
Clone URL: git://github.com/jamie/async-observer-amqp.git
name age message
file .gitignore Loading commit data...
file README Wed May 13 06:33:16 -0700 2009 0.2 gem, use Carrot client instead of AMQP [jamie]
file Rakefile Tue Aug 12 08:36:56 -0700 2008 extract hand-written code from app to gem [jamie]
file async-observer-amqp.gemspec
directory lib/
Dependencies
############

Async-Observer rails plugin, >=0.0.4: http://github.com/kr/async-observer
Carrot library, >=0.6.0: http://github.com/famoseagle/carrot/

A RabbitMQ server to connect to: http://www.rabbitmq.com/

Now uses Carrot gem instead of AMQP, so we don't need the EventMachine
dependency. Because dependent gem is on Github, you'll need to install
and require it yourself.

Usage
#####

Install this library and async-observer as plugins in your Rails app, and
ensure that the amqp library is available.  This plugin will reqire it,
so if it can't be found it'll be obvious.

In general, follow the instructions for async-observer, but instead of

  AsyncObserver::Queue.queue = Beanstalk::Pool.new(%w(localhost:11300))

to define the queue, do this instead:

  AsyncObserver::Queue.queue = AMQP::RabbitQueue.new(:host => 'localhost')

You can also pass along a port and login credentials for connecting with
the RabbitMQ server, see AMQP docs for more details.

In your runner scripts, instead of using an AsyncObserver::Worker, instead
use an AMQP::RabbitWorker, the interface is the same.


Merb Compatability
##################

This plugin also works with Merb, just install the gem to Merb.root/gems,
and mark it as a dependency in a Merb::BootLoader.before_app_loads block.

Worker scripts should work just fine.

I'm maintaining a merb-compatable fork of async-observer (until the changes
get pulled back in) here: http://github.com/jamie/async-observer


TODO
####

The original async-observer had a fallback to in-line execution of code if
the beanstalkd connection died.  Need to detect that error condition with
Carrot and recover accordingly.