public
Fork of kr/async-observer
Description: Rails/Merb plugin that provides deep integration with Beanstalk
Homepage: http://async-observer.rubyforge.org/
Clone URL: git://github.com/jamie/async-observer.git
name age message
file COPYING Thu Dec 13 21:13:13 -0800 2007 Add copyright notice and license. git-svn-id:... [kr]
file README Fri Jul 11 09:22:50 -0700 2008 Get async_each working with datamapper, documen... [jamie]
file Rakefile Wed Jul 09 12:55:30 -0700 2008 generate a gem, add file to lib so merb knows h... [jamie]
directory bin/ Thu May 08 11:51:55 -0700 2008 Remove code to run jobs in an alternate version... [kr]
directory generators/ Thu Jul 10 09:02:49 -0700 2008 get generator functioning, woo [jamie]
file init.rb Thu Dec 13 16:08:20 -0800 2007 Initial commit. git-svn-id: svn+ssh://rubyfor... [kr]
directory lib/ Thu Sep 25 12:07:56 -0700 2008 better safety when not using AR [jamie]
README
This is Async Observer -- a Rails plugin that provides deep integration with
Beanstalk.  It is also a Merb plugin, based on code by Chris Van Pelt.

For more information, see http://async-observer.rubyforge.org/.

For more information on Beanstalk, see its home page at
http://xph.us/software/beanstalkd/.


Configuration
=============

Rails
-----
In your enviroment file (either config/environment.rb, or the environment-
specific config files), add the following lines:

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

app_version should ideally be something that changes each time you update
your code.  Beanstalk::Pool.new should of course attempt to connect to
wherever your beanstalkd server is listening.

Merb
----
In init.rb, register the dependency in a before_app_loads block, like so:

  Merb::BootLoader.before_app_loads do
    dependency 'async_observer'
  end

This will occur after you have selected your ORM, which will then be auto-
detected.  Note that only ActiveRecord and DataMapper are currently supported.

Then, as above for Rails, connect to your Beanstalk server in the
after_app_loads block:

  Merb::Bootloader.after_app_loads do
    AsyncObserver::Queue.queue = Beanstalk::Pool.new(%w(localhost:11300))
    AsyncObserver::Queue.app_version = '1.0'
  end

If you intend to use async_each with DataMapper, you will need to add a
dependency on the dm-aggregates library, from dm-more.