Rails 3:实时服务器推送?
我正在尝试编写一个 Rails 3 应用程序,其中服务器可以将数据实时推送到多个客户端。
我听说过 Juggernaut,但我也听说它不能与 Rails 3 一起使用。我尝试过 APE(AJAX 推送引擎),但我不太幸运。
我对 Rails 很陌生。我找不到很多涉及实时推送和 Rails 3 的指南。我一直在寻找一个免费、简单(如果可能的话)的解决方案。如果有人能指出我正确的方向,我将不胜感激。
I'm trying to write a Rails 3 application in which a server can push data to multiple clients in real time.
I've heard of Juggernaut, but I've also heard that it does not work with Rails 3. I tried APE (AJAX Push Engine), but I'm not having much luck with it.
I'm very new to Rails. I can't find many guides that involve real-time push, and Rails 3. I was looking for a free, easy (if possible) solution to this. If anyone could point me in the right direction, I'd greatly appreciate it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
看看 Faye:http://faye.jcoglan.com/ - 我听到了一些关于它的好消息。
如果您正在寻找托管解决方案,我过去曾使用过 Pusher http://pusher.com/,并且很喜欢它。我在大约 30 分钟内将一个使用 ajax 轮询的网站转换为推送器。
Check out Faye: http://faye.jcoglan.com/ - I hear really good things about it.
if you're looking for a hosted solution, i've used Pusher http://pusher.com/ in the past, and loved it. i converted a site that used ajax polling over to pusher in about 30 minutes.
您可以尝试 juggernaut 来做您想做的事情。
github 存储库:https://github.com/maccman/juggernaut
Juggernaut 的应用示例: https://github.com/maccman/holla
享受吧:)
You can try juggernaut to do what you want.
The github repository : https://github.com/maccman/juggernaut
Example of application with juggernaut : https://github.com/maccman/holla
Enjoy :)
您是否研究过 http://socket.io ?如果我没记错的话,它为 Juggernaut 背后的推送功能提供动力。
这里似乎有一个 Rails 库: https://github.com/markjeee/Socket.IO -rack —— 它说 2.3+,我认为这意味着 3 就可以了(尽管我不是 Ruby 爱好者,所以我真的不知道)。
Have you looked into http://socket.io ? It powers the push functions behind Juggernaut, if I recall correctly.
There appears to be a library for Rails here: https://github.com/markjeee/Socket.IO-rack -- it says 2.3+, which I assume means 3 is ok (though I'm not a Ruby guy, so I wouldn't really know).
为了与 Pusher 建议保持一致,有 RMSN - 我使用 NowJS 编写的替代品。
https://github.com/leppert/RMSN
In keeping with the Pusher suggestion, there's RMSN - a drop in replacement I've written using NowJS.
https://github.com/leppert/RMSN
从 Rails 4 开始,您还可以使用 Entangled:
https://github.com/so-entangled/rails< /a>
它基本上通过网络套接字使客户端和服务器之间的所有数据保持实时同步。设置起来很容易,所以请尝试一下。
Starting with Rails 4, you could also use Entangled:
https://github.com/so-entangled/rails
It basically keeps all data between client and server in sync in real time through web sockets. It's easy to set up, so give it a try.