在Rails的服务器端推送 [英] Server-side Push in Rails

查看:115
本文介绍了在Rails的服务器端推送的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想实现在使用AJAX架的可伸缩的聊天室。我从研究中得知的唯一的可扩展性与发生在服务器端推送。

I'd like to implement a scalable chatroom in rails using AJAX. I know from research that the only scalability happens with a server-side push.

我的两个问题是:

1)在一个合理有效的聊天服务器,在什么时候投票成为望而却步? 2)我真的不希望使用剑圣。我不知道很多有关如何彗星的作品。我想我不知道这将是可怕的,我很难建立使用JavaScript(创建一个客户端服务器/轮询)和另一种语言(提供有效的轮询防火墙后面的客户端,以及融入CGI)。 3)(是的,出2),无论我甚至将它的正确方法?

1) In a reasonably efficient chat server, at what point does polling become prohibitive? 2) I really don't want to use Juggernaut. I don't know much about how comet works. I guess I'm wondering if this would be horribly difficult for me to build using Javascript (to create a client side server/poller) and another language (to provide efficient polling for clients behind a firewall, and an integration into the CGI). and 3) (yes, out of 2), whether I'm even going about it the right way?

最简单的答案我希望的是一个量化是的,你把5行的Javascript到客户端和20日线的红宝石成一个CGI脚本,收工。

The simplest answer I could hope for is a quantified "yes, you put 5 lines of Javascript into the client and 20 lines of ruby into a CGI script, and call it a day".

推荐答案

如果它是很容易做到的人就不会建这些技术。恕我直言,我认为投票是总是将是一个哈克的方式来做到这一点。这就是说....

If it was that easy to do people would not have built those technologies. IMHO I think polling is always a going to be a hacky way to do it. That Said....

我不知道为什么剑圣是关闭的卡一个家伙的建立了这个网站 64Squares 的一个工作,它是伟大工程。

I am not sure why Juggernaut is off the cards A guy a work for built this site 64Squares with it and is works great.

我知道其他网站,如 WeeWar 使用轮询方法,他们有向上或400请求最小。因此,我认为它会采取之前的某个时候的比例成为一个问题。

I know other sites such as WeeWar use the polling method and they have upwards or 400 request a Min. So I think it would take sometime before the scaling became an issue.

好运气

干杯

这篇关于在Rails的服务器端推送的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆