Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update README.md

  • Loading branch information...
commit 3269e68f4f8aa95de86b5acce1ed2c777a87f388 1 parent d786a11
@jondot authored
Showing with 60 additions and 14 deletions.
  1. +60 −14 README.md
View
74 README.md
@@ -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](http://www.rabbitmq.com/blog/2012/04/17/rabbitmq-performance-measurements-part-1/), portability - [almost every worthy server-side language and platform](http://www.rabbitmq.com/devtools.html) 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](http://redis.io/topics/sentinel-spec) is quite a progress - hurray!).
+
+
+Here are [great background slides](https://speakerdeck.com/u/hungryblank/p/rails-underground-2009-rabbitmq) given by Paolo Negri over Rails Underground 2009 about [RabbitMQ](http://www.rabbitmq.com/).
## 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.
+
+`image`
+
+Changing the bound address is easy to do through the many options you can pass to the running `Context`:
+
+```ruby
+f = FrenzyBunnies::Context.new :web_host=>'0.0.0.0', :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
+```ruby
+: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'
+```ruby
+: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
+Example:
-Or install it yourself as:
+```ruby
+FrenzyBunnies::Context.new :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
+
Please sign in to comment.
Something went wrong with that request. Please try again.