高效服务器推轨
我想知道通过 Rails 运行的高效服务器推送技术。探索的有XMPP-Bosh、comet等。
这些长轮询技术对移动端的电池消耗有多大影响。需要的是数据到达服务器后立即将其推送到客户端(数据大小和类型不固定,可能以 mb 为单位变化)。
请对此进行一些说明。任何技术/东西/链接/黑客/Ruby &同样的 Python 模块会很棒。
I would like to know the efficiecnt server push technique working through rails. The ones explored are XMPP-Bosh , comet etc.
How much effect would these long polling technique have on battery consumpition at mobile end. The need is to push the data to the client as soon as it gets to the server (the data size and type is not fixed and can vary in mb's).
Please throw some light on this. Any technique/stuff/links/hacks/Ruby & Python modules for the same would be great.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道你到底想做什么,也不知道对手机电池消耗的影响,但我知道几种简单的方法可以在没有 websocket 的情况下将数据推送到浏览器:
Mongrel 1.1.5 很旧,但有一些功能小初始化程序修复它仍然是不断将数据推送到前面的最简单方法。
NGINX 和 Apache 提供了一个模块,但我没有找到一种方法来按照我想要的方式调整它,从我所看到的来看,它不是很灵活。
如果您正在构建聊天,请考虑 Openfire(非常易于使用......RED5 插件、kraken 等...)或带有频谱网关的 jabberd。
此外,xmpp4r gem 非常完整。
如果您要流式传输静态文件或任何类型的大数据,您可能需要为 Web 服务器使用流式传输模块。
I don't know exactly what you want to do or the effect on battery consumption on a mobile phone but I know several easy ways to push your data to a browser without a websocket:
Mongrel 1.1.5 is old but with some small initializer fix it still is the easiest way to continually push data in front.
NGINX and Apache provide a module but I didn't find a way to tweak it like I want, it's not very flexible from what I saw.
If you are building a chat think about Openfire (very easy to use....RED5 plugin, kraken ect..) or jabberd with a spectrum gateway.
Also, the xmpp4r gem is very complete.
If you are streaming static files, or big data of any type, you might want to use a streaming module for the web server.