实时红宝石应用:CRAMP node.js的VS [英] Real time ruby apps: CRAMP vs NODE.JS

查看:119
本文介绍了实时红宝石应用:CRAMP node.js的VS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在想,如果你们有见解关于哪一个更好,与哪些因素应该使用其中之一,当考虑到

I was wondering if any of you had insights about which one is better, and what factors should be taken into consideration when using one of these

推荐答案

我可以说比其他(Node.js的)侧多。我只是写了使用Rails 3使用Node.js的一个后端,用于收听的Redis PubSub的消息,并相应地更新Rails的前端集成了一个宝石。

I can speak more from the other (Node.js) side. I just wrote a gem that integrates with Rails 3 that uses a Node.js back-end for listening to Redis PUBSUB messages and updates the Rails front-end accordingly.

Socket.IO +节点是不是很难与Rails应用程序(特别是如果使用jQuery),但是这取决于你的目标浏览器基础(如IE7),也可以是棘手的在所有情况下正确的工作,即整合由于一些奇怪的情况下,使用Flash插槽作为备用(通常在那里的WebSockets不工作)时。

Socket.IO + Node is not hard to integrate with a Rails app (especially if working with jQuery), but depending on your targeted browser base (like IE7), it can be tricky to get working right in all cases, namely because of some weird cases when using Flash Socket as a fallback (usually where WebSockets don't work).

这是说,我强烈推荐的Node.js + Socket.IO。它是超轻量级的有很多的选择和灵活性,延长做几乎任何事情你能想到。在我看来,Rails是一个用于构建需要计算繁重的前端更大的应用程序一个梦幻般的Web框架。我不会选择使用它的小,事件驱动应用程序,只是因为它使用这么多的内存单独的框架。我喜欢的Ruby / Rails,但是当涉及到​​一些需要快速和干净的事件处理/信息处理,节点有我的投票。

That said, I highly recommend Node.js + Socket.IO. It is super light-weight with a lot of options and flexibility to extend to do almost anything you could want. In my opinion, Rails is a fantastic web framework for building bigger apps that need a computationally heavy front-end. I would not choose to use it for small, event driven applications simply because it uses so much memory for the framework alone. I love Ruby/Rails, but when it comes to needing something for quick and clean event processing/message handling, Node has my vote.

如果您需要更具体的例子,我的项目Kthxbye(一Resque式的克隆)与这又是Node.js的这反过来又可以更新的Web应用程序听了Redis的通信。

If you need more concrete examples, my project Kthxbye (a Resque-esque clone) communicates with Redis which in turn is listened to by Node.JS which in turn can update a web application.

插件 http://github.com/plukevdh/kthxbye (参见:的http://github.com/plukevdh/kthxbye/blob/master/lib/generators/kthxbye/templates/kthxbye.js)

节点后端 http://github.com/plukevdh/kthxbye-节点(参见: http://github.com/plukevdh /kthxbye-node/blob/master/poll.js

(对于完全缺乏的节点项目文件的道歉。)

(Apologies for the complete lack of documentation on the node project.)

这篇关于实时红宝石应用:CRAMP node.js的VS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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