Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A synchronous amqp client

tree: 05c24f3bb0

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 protocol adding aman's amqp code March 20, 2009
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore Initial commit to carrot. March 20, 2009
Octocat-spinner-32 LICENSE adding examples and readme April 08, 2009
Octocat-spinner-32 README.markdown
Octocat-spinner-32 Rakefile
Octocat-spinner-32 VERSION.yml
Octocat-spinner-32 carrot.gemspec
README.markdown

Carrot

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

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.

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

Something went wrong with that request. Please try again.