Coder Social home page Coder Social logo

Carrot

A synchronous amqp client. Based on Aman's amqp client:

[http://github.com/tmm1/amqp/tree/master] (http://github.com/tmm1/amqp/tree/master)

Motivation

This client does not use eventmachine so no background thread necessary. As a result, it is much easier to use from script/console and Passenger. It also solves the problem of buffering messages and ack responses. For more details see [this thread] (http://groups.google.com/group/ruby-amqp/browse_thread/thread/fdae324a0ebb1961/fa185fdce1841b68).

There is currently no way to prevent buffering using eventmachine. Support for prefetch is still unreliable.

Example

require 'carrot'

q = Carrot.queue('name')
10.times do |num|
  q.publish(num.to_s)
end

puts "Queued #{q.message_count} messages"
puts

while msg = q.pop(:ack => true)
  puts "Popping: #{msg}"
  q.ack
end
Carrot.stop

LICENSE

Copyright (c) 2009 Amos Elliston, Geni.com; Published under The MIT License, see License

Nimbul NYT's Projects

activemessaging icon activemessaging

ActiveMessaging moved from google code - this will be the latest and greatest

cloudmaster icon cloudmaster

Ruby library and command-line tools to manage Amazon EC2

cloudsource icon cloudsource

CloudSource is a simple role-based SVN / bash deployment tool developed by The New York Times' Automation and Infrastructure Group. CloudBased is based on ServerMattic scripts developed by WordPress.

emissary icon emissary

EventMachine/AMQP based event handling client

nimbul icon nimbul

Nimbul is a Cloud Manager developed by The New York Times's Infrastructure and Automation Group

resque-loner icon resque-loner

Support for unique jobs in defunkt/resque: Only one job with the same payload per queue.

ruby-uuid icon ruby-uuid

Pure-ruby UUID generator/parser in <300 lines. It fully supports UUID versions 1, 3, 4 and 5.

rye icon rye

Safe, parallel access to Unix shells from Ruby

spawn icon spawn

spawn plugin for Rails to easily fork or thread long-running code blocks

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.