Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

secure_carrot

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

secure_carrot

  • 0.2.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

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 'secure_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

Encrypting and Decrypting messages

Symmetric encryption is used here which means the same password is used for encrypting and decrypting the message.

puts "Encrypt and send a message"
q.send_message('Hello Carrot', :password => 'secure')
#=> "qrbSyJHx6JhBQtXKsWvm/A==\n"

puts "Receiving and decrypting message. If you don't specify the password you will read an encrypted message."
q.receive_message(:password => 'secure')
#=> "Hello Carrot"

LICENSE

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

FAQs

Package last updated on 09 Sep 2010

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc