简体   繁体   English

如何在node.js和rails中链接两个应用程序?

[英]How do I link two apps in node.js and rails?

I run a social network app built in ruby on rails 4. We want to improve it and add realtime and add live streaming features. 我运行了一个在ruby 4上构建的社交网络应用程序。我们希望对其进行改进并添加实时性并添加实时流功能。 We also want to make 'likes', 'comments' features real time. 我们还想实时制作“喜欢”,“评论”功能。 My lead programer says ruby on rails is not good for this and not possible and only way is to do it in node.js however doesnt know any solution to link node.js application to rails. 我的首席程序员说ruby on rails对此不利,并且不可能,唯一的方法是在node.js中做到这一点,但是不知道将node.js应用程序链接到rails的任何解决方案。 I'm a business guy and not technical and need info to let him know it can be done. 我是业务人员,不是技术人员,需要信息让他知道可以做到的。

Rails 4 doesn't have streaming(like websocket, maybe streaming is not good word in this context) functional from box, but many gems exist for this: https://rubygems.org/search?utf8=%E2%9C%93&query=websocket . Rails 4没有框内的流功能(例如websocket,在这种情况下流可能不是一个好词),但是为此存在很多宝石: https ://rubygems.org/search?utf8=%E2%9C%93&query = websocket However you can use websocket.io if you decide it is a better solution, for example, in my current project we use websocket.io for send a notifications for mobile application through websocket: rails and nodejs exchanging data through Redis. 但是,如果您确定它是一个更好的解决方案,则可以使用websocket.io,例如,在我当前的项目中,我们使用websocket.io通过websocket发送移动应用程序的通知:rails和nodejs通过Redis交换数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM