Browse files


  • Loading branch information...
1 parent d786a11 commit 3269e68f4f8aa95de86b5acce1ed2c777a87f388 @jondot committed Sep 8, 2012
Showing with 60 additions and 14 deletions.
  1. +60 −14
@@ -7,10 +7,26 @@ Unlike other background job processing libraries, a Frenzy Bunnies worker is off
This firstly means the processing model isn't process-per-worker (saving memory) and it also isnt fixed-thread-per-worker based (saving memory even further).
+RabbitMQ is a really awesome queue solution for background jobs as well as more real-time messaging processing. Within its strengths are its [performance](, portability - [almost every worthy server-side language and platform]( has a RabbitMQ driver and you're not limited to process on a single platform, and high-availability out of the box (as opposed to Redis, although [Sentinel]( is quite a progress - hurray!).
+Here are [great background slides]( given by Paolo Negri over Rails Underground 2009 about [RabbitMQ](
## Quick Start
-You basically just need to define a worker in its own class, and then
+Add this line to your application's Gemfile:
+ gem 'frenzy_bunnies'
+And then execute:
+ $ bundle
+Or install it yourself as:
+ $ gem install frenzy_bunnies
+Then, you basically just need to define a worker in its own class, and then
decide if you want to use the Frenzy Bunnies runner
`frenzy_bunnies` to run it, or do it programmatically via the
`FrenzyBunnies::Context` API.
@@ -38,7 +54,7 @@ to an error queue).
### Running with CLI
-Running a worker with the command-line binary is easy
+Running a worker with the command-line executable is easy
$ frenzy_bunnies start_workers worker_file.rb
@@ -61,34 +77,63 @@ Which will run your workers immediately.
## Web Dashboard
+When FrenzyBunnies run, it will automatically create a web dashboard for you, on `localhost:11333` by default.
+Changing the bound address is easy to do through the many options you can pass to the running `Context`:
+f = :web_host=>'', :web_port=>11222
context definitions
## In Detail
-### Tweaking Workers
+### Worker Configuration
-worker definitions
+say `from_queue 'queue_name'` and pass any of these options:
-running context definitions
+:prefetch # default 10. number of messages to prefetch each time
+:durable # default false. durability of the queue
+:timeout_job_after # default 5. reject the message if not processed for number of seconds
+:threads # default none. number of threads in the threadpool. leave empty to let the threadpool manage it.
-### AMQP Queue Wireup
+### General Configuration
-Add this line to your application's Gemfile:
+Global / running configuration can be set through the running context `FrenzyBunnies::Context`, pass any of these as options (shown with defaults).
- gem 'frenzy_bunnies'
+:host # default 'localhost'
+:exchange # default 'frenzy_bunnies'
+:heartbeat # default 5
+:web_host # default 'localhost'
+:web_port # default 11333
+:web_threadfilter # default /^pool-.*/
+:env # default ''
-And then execute:
- $ bundle
-Or install it yourself as:
+```ruby :exchange=> 'foo'
- $ gem install frenzy_bunnies
+### AMQP Queue Wiring Under the Hood
-## Usage
+If you're interested with the mechanics, in order to mimic a background-job / work-queue
+semantics, the following is the AMQP wireup used within this library:
-TODO: Write usage instructions here
+* Durable per configuration
+* The exchange is created and named by default `frenzy_bunnies`
+* Each worker is bound to an AMQP queue named `my_queue`_`environment` with the environment postfix appended automatically.
+* The routing key on the exchange is of the same name and bound to the queue.
## Contributing
@@ -97,3 +142,4 @@ TODO: Write usage instructions here
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

0 comments on commit 3269e68

Please sign in to comment.