Sparrow 正在参加 2021 年度 OSC 中国开源项目评选,请投票支持!
Sparrow 在 2021 年度 OSC 中国开源项目评选 中已获得 {{ projectVoteCount }} 票,请投票支持!
2021 年度 OSC 中国开源项目评选 正在火热进行中,快来投票支持你喜欢的开源项目!
2021 年度 OSC 中国开源项目评选 >>> 中场回顾
Sparrow 获得 2021 年度 OSC 中国开源项目评选「最佳人气项目」 !
授权协议 MIT
开发语言 Ruby
操作系统 跨平台
软件类型 开源软件
开源组织
地区 不详
投 递 者 红薯
适用人群 未知
收录时间 2013-01-16

软件简介

Sparrow 是一个非常快速而且轻量级的 Ruby 消息队列,遵循 memcached 协议,意味着你可以使用任何 Ruby 的 memcached 客户端来连接到 Sparrow 服务。Sparrow 将消息保存在内存中,并在关闭时通过 SQLite 将消息持久化到磁盘。

示例代码:

class MyQueue < MQueue::Queue
  def on_message(args)
    puts "Received msg with args: #{args.inspect}"
  end
end

SQS.access_key_id = 'YOURACCESSKEYID'
SQS.secret_access_key = 'YOURSECRETACCESSKEY'
   
servers = [
   MQueue::Protocols::Sparrow.new({:host => 'localhost', :port => 11212, :weight => 1}),
   MQueue::Protocols::SQS.new({:weight => 0})
]

MyQueue.servers = servers
MyQueue.publish 'test'
MyQueue.run

MyQueue.publish 'test'

MyQueue.run

展开阅读全文

评论

点击加入讨论🔥(1) 发布并加入讨论🔥
暂无内容
发表了博客
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
发表了问答
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
暂无内容
1 评论
14 收藏
分享
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部