彗星还不成熟吗?

发布于 2024-11-03 16:06:46 字数 447 浏览 0 评论 0原文

我正在考虑编写一个实时网络应用程序,它需要能够将消息推送到浏览器。当我第一次读到 Comet 时,由于浏览器支持薄弱,人们似乎认为它是一种脆弱且不成熟的方法。今天,这似乎是一种既定且实用的技术。但据我所知,浏览器现在对基本方法(长轮询、iframe 和脚本标签)的支持并不比 06 年这个想法首次流行时更好。

当然,在服务器端管理所有这些连接是很困难的,但是 Comet 框架解决了这个问题(甚至在 06 年就可以通过 Twisted 之类的东西实现)。那么到底是怎么回事:浏览器中的 Comet 支持是否存在任何破坏性的问题,或者当时的人们只是错了?

另外:我最近阅读了一篇大约 2010 年的博客文章,总结了 Comet 技术的现状,详细介绍了每种方法。听起来这些方法都不是真正可行的。这篇文章很有说服力,这就是为什么我仍然对彗星感到紧张。关于该博客,我唯一记得的是它有一个深色背景(棕色或黑色)。还有其他人看过那个帖子吗?我真的很想再读一遍。

I'm thinking of writing a realtime web app that would need to be able to push messages to the browser. When I first read about Comet, people seemed to consider it a brittle and immature approach due to weak browser support. Today, it seems to be an established and practical technique. But as far as I know, browers don't support the basic methods (long polling, iframes and script tags) any better now than they did in '06 when the idea first became popular.

Of course, it's difficult to manage all of those connections on the server side, but Comet frameworks solve that problem (and it was doable even back in '06 with something like Twisted). So what's the deal: are there any deal-breaking problems with Comet support in browsers, or were the people back then just wrong?

Also: I recently read a ~2010 blog post summarizing the state of Comet technology, covering each method in detail. It made it sound like none of the methods were really viable. The post was very persuasive, which is why I'm still edgy about Comet. The only thing I can remember about the blog is that it had a dark background (brown or black). Has anyone else seen that post? I'd really like to read it again.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

鹤舞 2024-11-10 16:06:46

我认为 Comet 现在非常可行,每个浏览器都支持长轮询,因此您有一个仍然有效的通用回退,并且每个浏览器中都有比长轮询性能更高的方法。

你只是不经常看到它,因为在每个浏览器中支持不同的方法是一项相当大的任务,谷歌和 Facebook 有资源来做到这一点,但你的普通网络开发人员。会浪费大量时间却收效甚微。您真正需要彗星提供的实时通信的应用程序只有这么多。

我认为现在有了 APE 和 cometD 等为您提供后端和客户端实用程序的框架,您会看到更多的人能够承担复杂的任务。无论如何,它不可能不成熟,彗星只是一种以非常新颖的方式利用现有功能的技术。

I would argue that comet is very viable right now, every browser supports long polling so you have a common fallback that will still work, and there are methods in each browser that will be more performant than long polling.

You just don't see it very often because its quite a big undertaking to support the different methods in each browser, google and facebook have the resources to do it, but your average joe web dev. would be wasting a lot of time for very little gain. There are only so many applications where you really need the real time communication comet provides.

I think now with frameworks like APE and cometD that give you the backend and the client side utilities you are seeing more people able to take on the complicated tasks. It can't be immature anyway, comet is just a technique that uses existing capabilities in a very novel way.

┼── 2024-11-10 16:06:46

我认为浏览器相对于彗星并没有太大变化,一切都保持着几年前的样子。其所有的黑客性都完好无损。 WebSockets 将是最终的答案,因此浏览器制造商并不急于修复commet,但该“标准”仍在不断变化。

I don't think that the browsers have changed much with respect to comet everything remains as it was a few years ago. With all of its hackiness intact. WebSockets will be the eventual answer so browser makers are in no hurry to fix commet, but that "standard" is still in flux.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文