你好,游客 登录 注册 搜索
背景:
阅读新闻

Bunny 9.2 发布,RabbitMQ 的 Ruby 开发包

[日期:2013-07-25] 来源:oschina.net  作者:Linux [字体:大 中 小]

Bunny 9.2 发布了,该版本确保在任意连接恢复之前初始化新的连接传输 (socket),提升了自动网络失效时的恢复。详情请看 ChangeLog。

Bunny 是一个非常受欢迎的、易用的、可维护的 RabbitMQ 2.0+ 的 Ruby 客户端开发包。

示例代码:

require "bunny"

# Start a communication session with RabbitMQ
conn = Bunny.new
conn.start

# open a channel
ch = conn.create_channel

# declare a queue
q  = ch.queue("test1")

# publish a message to the default exchange which then gets routed to this queue
q.publish("Hello, everybody!")

# fetch a message from the queue
delivery_info, metadata, payload = q.pop

puts "This is the message: #{payload}"

# close the connection
conn.stop

Bunny 的下载地址:请点这里

linux
相关资讯       Bunny 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款