Code Monkey home page Code Monkey logo

warren's Introduction

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.

warren's People

Contributors

caius avatar davidsmalley avatar

Stargazers

Angus H. avatar Arno Moonen avatar Truong Hoang Dung avatar kaka avatar Ryan Carter avatar Ast avatar Igor avatar  avatar Cyrus avatar  avatar Elijah Wright avatar John Apps avatar alexis richardson avatar Ancor Cruz avatar  avatar Max Justus Spransy avatar Alberto Perdomo avatar Richard Taylor avatar Brian Demant avatar  avatar Marco Lazzeri avatar Kris Rasmussen avatar Stefan Kaes avatar Dmitriy Samovskiy avatar Maximilian Schoefmann avatar Daniel Morris avatar Charles Francis avatar Ilya Grigorik avatar Deepak Kannan avatar Kenneth Kalmer avatar Peter Hoffmann avatar Jinzhu avatar Lalit Shandilya avatar Deb Bassett avatar Anderson Peligrini avatar Mathias Meyer avatar Fabio Akita avatar Paolo Negri avatar Colin Surprenant avatar Dane Jensen avatar Paul Ingles avatar Aaron Quint avatar Randy Schmidt avatar Matt Murphy avatar PabloC avatar  avatar Nicholas Mulder avatar Chris Williams avatar Lourens Naudé avatar Mihai Anca avatar Dean Strelau avatar

Watchers

Hemant Kumar avatar John Leach avatar Deb Bassett avatar Steve Smith avatar  avatar Ben Arblaster avatar James Cloos avatar  avatar  avatar  avatar

warren's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.