github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

brightbox / warren

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 56
    • 3
  • Source
  • Commits
  • Network (3)
  • Issues (0)
  • Downloads (3)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (3)
    • 0.9.0
    • 0.8.6
    • 0.8.2
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Wrapper for AMQP — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

[RELEASE] 0.9.2 - Following the white rabbit. 
Caius Durling (author)
Mon Dec 21 08:43:19 -0800 2009
commit  1c0dd919b9236a2bac300770cb2d2673f10cbd91
tree    627072eae8219d9df24a75b13ca33393feefcf13
parent  5735bbf600e27ae9743191d6de45e40e66513715
warren /
name age
history
message
file .gitignore Fri Jun 12 10:14:27 -0700 2009 Ignoring pkg directory. [Caius Durling]
file CHANGELOG Mon Dec 21 10:20:12 -0800 2009 [RELEASE] 0.9.2 - Following the white rabbit. [Caius Durling]
file LICENSE Fri Jun 12 10:06:29 -0700 2009 Updating readme and spelling license properly. [Caius Durling]
file Manifest Mon Dec 21 10:20:12 -0800 2009 [RELEASE] 0.9.2 - Following the white rabbit. [Caius Durling]
file Rakefile Mon Dec 21 08:41:21 -0800 2009 Bunny adapter now requires bunny >= 0.6.0 due t... [Caius Durling]
directory examples/ Fri Jun 12 09:44:39 -0700 2009 Updated examples. Simple now has examples of b... [Caius Durling]
directory lib/ Mon Dec 21 10:20:12 -0800 2009 Speccing Queue#subscribe and refactoring it to ... [Caius Durling]
file readme.rdoc Loading commit data...
directory spec/ Mon Dec 21 10:20:12 -0800 2009 Speccing Queue#subscribe and refactoring it to ... [Caius Durling]
directory tasks/ Fri Mar 13 09:39:51 -0700 2009 Adding documentation [Caius Durling]
file warren.gemspec Mon Dec 21 10:20:12 -0800 2009 [RELEASE] 0.9.2 - Following the white rabbit. [Caius Durling]
readme.rdoc

Warren

Library for sending and receiving messages, complete with en/decrypting messages on either side of the transport.

It was written to handle sending messages between two nodes using RabbitMQ, which is why the two default adapters are for synchronous and asynchronous rabbitmq client libraries. You can delegate the sending & receiving to any custom class you want, simply by subclassing Warren::Queue. (Isn’t ruby magic marvelous!)

The filtering works in much the same way as the adapter class. There is a default YAML filter that is always called last before sending the message and first when receiving the message, simply to make sure the message is a string when sent + received. You can then add custom classes onto the stack in any order you want, simply by subclassing Warren::MessageFilter. Add them in the same order on the receiving side and warren takes care of calling them in reverse order.

Start by looking at examples/ to see how to use it, and then lib/warren/adapters/ to see how to implement your own adapter class and lib/warren/filters to see how to implement your own filters.

Installation

    gem install brightbox-warren

Usage

    require "rubygems"
    require "warren"
    # Use the bunny adapter to connect to RabbitMQ (Bunny is an AMQP client that works with Rails/Passenger apps)
    require "warren/adapters/bunny_adapter"
    # If you're running in development and don't want to actually push messages onto the queue then instead of loading the bunny adapter use the dummy adapter
    require "warren/adapters/dummy_adapter"

    # See examples/ for more

Rails

Add this to your environment.rb

    config.gem "brightbox-warren", :lib => "warren", :version => ">= 0.8"

Add the config into config/warren.yml with the details for each environment. Works just the same as database.yml:

    development:
        user: rabbit
        pass: carrots53
        host: rabbit.warren
        logging: false

And then in an initializer file (or bottom of environment.rb) require the adapter you want to use (for rabbitmq I suggest bunny - amqp uses eventmachine and was giving me issues under passenger.) And then any filters you want to use.

    require "warren/adapters/bunny_adapter"

License

Licensed under the MIT license. See LICENSE for more details.

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server