简体   繁体   English

技术behing创建像异步Web应用程序的谷歌浪潮

[英]Technique behing creating a google wave like asynchronous web app

I want to try creating a canvas were multiple users can type and edit for brainstorming etc. I am thinking of php as backend. 我想尝试创建一个画布,多个用户可以键入和编辑头脑风暴等。我在想作为后端的PHP。 What are the technique used for it? 它使用的技术是什么? For example, lets say its pure text. 例如,让我们说它的纯文本。 How do we update the text like in the google wave(b4) and in google doc? 我们如何更新google wave(b4)和google doc中的文本?

Is it just using websocket(or js pooling) and updating the text file? 它只是使用websocket(或js池)并更新文本文件? or are there any better logical way to solve this issue? 或者有更好的逻辑方法来解决这个问题吗?

Websockets are the way to go for this. Websockets是实现这一目标的方法。 However, they are difficult to implement in PHP, and not supported by many browsers as of yet. 但是,它们很难在PHP中实现,并且尚未被许多浏览器支持。 You can do long-polling of AJAX requests pretty easily with PHP, but it can be quite a waste of resources. 您可以使用PHP轻松地对AJAX请求进行长轮询,但这可能会浪费资源。

This might not be what you are looking for, but I'd suggest changing your server-side technology. 这可能不是您想要的,但我建议您更改服务器端技术。 You can use Node.js with Socket.IO to easily use Websockets (or seemlessly emulate them for browsers that don't support them). 您可以将Node.jsSocket.IO一起使用以轻松使用Websockets(或者为不支持它们的浏览器无缝地模拟它们)。 This will provide the fastest method for pushing data to your users. 这将为将数据推送给用户提供最快捷的方法。

Well, its not as easy as it is said in Brad's answer but he is partially right. 好吧,它不像布拉德的答案那么容易,但他部分正确。 You will definitely need WebSockets today to make it happen. 您今天肯定需要WebSockets来实现它。 But logically, it is not that simple to create a collaborative environment. 但从逻辑上讲,创建协作环境并不是那么简单。 There are issues like broadcasting changes of every user to every other user viewing the same document. 存在诸如每个用户向观看同一文档的每个其他用户广播改变的问题。 Then you will have to make sure that every user gets to see exactly the same thing no matter who changes what and when. 然后你必须确保每个用户都能看到完全相同的东西,无论谁改变什么和什么时候。 This gets difficult when multiple users are working on the same document collaboratively. 当多个用户协同处理同一文档时,这变得困难。 There can be conflicts while merging changes of one another. 合并彼此的变化时可能会发生冲突。

As far as PHP is concerned, language is not really a problem. 就PHP而言,语言并不是一个真正的问题。 Its how you handle the above stated problem. 它是如何处理上述问题的。

Google released its research and engineering details on Google Wave (I guess after abandoning the project). 谷歌在Google Wave上发布了研究和工程细节(我想在放弃该项目后)。 This link might be some help to you: http://www.waveprotocol.org/whitepapers/ 这个链接可能对您有所帮助: http//www.waveprotocol.org/whitepapers/

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

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