如何实现彗星? [英] How to implement Comet ?

查看:238
本文介绍了如何实现彗星?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在开发Web应用程序一段时间,但已经非常最近推出了与彗星服务器端推送技术,我的这种技术的理解是非常不成熟的。虽然链接 http://www.zeitoun.net/articles/comet_and_php/start 提供使用PHP无限循环2简单的示例实现,我想知道更多关于上述方法的repurcussions,如果它是适合生产。 有什么优势呢像流星(http://meteorserver.org/),streamhub(http://www.stream-hub.com/)专用彗星服务器,freeliberator(http://www.freeliberator.com/index.php )?

另外如何不同的是,彗星的服务器端推送从HTML5网页插座设施?

我的主要目标是建立协同实时文档编辑工具的变体。

解决方案
  

虽然链路<一href="http://www.zeitoun.net/articles/comet_and_php/start">http://www.zeitoun.net/articles/comet_and_php/start提供了一种使用PHP中的无限循环2简单的示例实现,我想知道更多关于上述方法的repurcussions,如果它是适合制作。

此溶液是那造成对该PHP和彗星/ WebSockets的不缩放concencus的因素之一。参见:

  • href="http://stackoverflow.com/questions/1961206/solution-for-comet-and-php">解决方案
  • 使用彗星PHP?
  

什么优势做到像流星彗星专用服务器(http://meteorserver.org/),streamhub(http://www.stream-hub.com/),freeliberator(http://www.freeliberator.com/的index.php)?

的优点是,这些解决方案均建有处理记多个并发连接的想法。他们还提供它提供额外的功能,如发布/订阅,你可能要和库因此,必须实现自己。我曾在卡普林系统是谁建的解放者的产品,它的建成完全是一种高度优化的软件解决方案,来处理和解决这个问题的解决方案。

  

另外如何不同的是,彗星的服务器端推送从HTML5网页插座设施?

从<一个采取回答href="http://stackoverflow.com/questions/7788842/ajax-comet-is-there-any-solution-microsoft-is-working-on-or-supports-to-allow#7795439">here:

  

彗星是一个总称,有很多彗星服务器(见   下文)使用的WebSockets作为传输机制时可能的。   彗星服务器不只是使用AJAX,XHR长轮询,永远帧   等等。他们现在使用的WebSockets和后备其他运输   机制在需要。

     

下面只是一些使用的WebSockets的彗星服务器:

     
      
  • StreamHub:   <一href="http://streamhub.blogspot.com/2010/12/html-5-web-sockets-arrives-in-streamhub.html">http://streamhub.blogspot.com/2010/12/html-5-web-sockets-arrives-in-streamhub.html
  •   
  • APE(本地的WebSockets): http://www.ape-project.org/
  •   
  • 在卡普林解放者:<一href="http://www.caplin.com/caplin_liberator.php">http://www.caplin.com/caplin_liberator.php
  •   
  • 洄游:<一href="http://migratory.ro/migratory-push-server.html">http://migratory.ro/migratory-push-server.html
  •   
  • CometD:<一href="http://cometdproject.dojotoolkit.org/documentation/2.x/howtos/websocket">http://cometdproject.dojotoolkit.org/documentation/2.x/howtos/websocket
  •   
     

我的主要目标是建立协同实时文档编辑工具的变种。

我建议你不要尝试和实施从零开始彗星/ WebSockets的解决方案。这是一个很容易理解的问题了一批优秀的解决方案。而解决方案仍然不是简单的从头来实现。你需要解决有趣的问题是跨多个客户端的状态同步中的一个,这些现有的实时技术的伟大的事情是,你可以使用它们,集中精力建设你的应用程序。

也可能感兴趣的:

I have been developing web applications for some time but have very recently been introduced with the Comet server side push technology and my understanding of this technology is very immature. While the link http://www.zeitoun.net/articles/comet_and_php/start provides two simplistic example implementations using an infinite loop in PHP, I would like to know more on the repurcussions of the above methods and if it is suitable for production. What advantages do dedicated comet servers like Meteor(http://meteorserver.org/) , streamhub (http://www.stream-hub.com/), freeliberator (http://www.freeliberator.com/index.php) ?

Also how different is Comet server side push from HTML5 web socket facility ?

My principle objective is to build a variant of collaborative real time document editing facility.

解决方案

While the link http://www.zeitoun.net/articles/comet_and_php/start provides two simplistic example implementations using an infinite loop in PHP, I would like to know more on the repurcussions of the above methods and if it is suitable for production.

This solution is one of the factors that has resulted in the concencus that PHP and Comet/WebSockets don't scale. See:

What advantages do dedicated comet servers like Meteor(http://meteorserver.org/) , streamhub (http://www.stream-hub.com/), freeliberator (http://www.freeliberator.com/index.php) ?

The advantages are that these solution were built with the idea of handling multiple concurrent connections in mind. They also provide libraries which offer additional functionality such as pub/sub which you are likely to want and therefore have to implement yourself. I worked for Caplin Systems who built the Liberator product and it's a highly tuned software solutions built entirely to handle and solve this solution.

Also how different is Comet server side push from HTML5 web socket facility ?

Answer taken from here:

Comet is an umbrella term and there are many "Comet Servers" (see below) that use WebSockets as the transport mechanism when possible. Comet servers don't just use AJAX, XHR Long-Polling, Forever-Frame etc. They now use WebSockets and fallback to other transport mechanisms where required.

Here are just some of the "Comet Servers" that use WebSockets:

My principle objective is to build a variant of collaborative real time document editing facility.

I'd recommend that you don't try and implement a solution for Comet/WebSockets from scratch. It's a very well understood problem with a number of excellent solutions. And the solution still isn't simple to implement from scratch. The interesting problem you'll need to solve is one of state synchronisation across multiple clients so the great thing about these existing realtime technologies is that you can use them and concentrate on building your app.

Possibly also of interest:

这篇关于如何实现彗星?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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