Comet: Low Latency Data for the Browser

Python中网络页面抓取和页面分析 转载本文请以链接形式注明出处。 1.前言         Python的网络抓取有很多包可以实现,比如:urllib、urllib2、httplib、httplib2。其中httplib、httplib2是专门处理与http相关的;而urllib、urllib2是借助于httplib、httplib2实现的,相当于在httplib、httplib2上又封装了一层来进行处理web数据。而urll 阅读详情

An old web technology is slowly being resurrected from the depths of history. Browser features that have gone untouched for years are once again being employed to bring better responsiveness to UIs. Servers are learning to cope with a new way of doing things. And I’m not talking about Ajax.

New services like Jot Live and Meebo are built with a style of data transmission that is neither traditional nor Ajax. Their brand of low-latency data transfer to the browser is unique, and it is becoming ever-more common. Lacking a better term, I’ve taken to calling this style of event-driven, server-push data streaming “Comet”. It doesn’t stand for anything, and I’m not sure that it should. There is much confusion about how these techniques work, and so using pre-existing definitions and names is as likely to get as much wrong as it would get right.

Defining Comet

For a new term to be useful, at a minimum we need some examples of the technology, a list of the problems being solved, and properties which distinguish it from other techniques. As with Ajax, these aren’t hard to find. A short list of example applications includes:

So what makes these apps special? What makes them different from other things that might at first glance appear similar? Fundamentally, they all use long-lived HTTP connections to reduce the latency with which messages are passed to the server. In essence, they do not poll the server occasionally. Instead the server has an open line of communication with which it can push data to the client.

From the perspective of network activity, we can modify JJG’s original Ajax diagram to illustrate how Comet differs:

As is illustrated above, Comet applications can deliver data to the client at any time, not only in response to user input. The data is delivered over a single, previously-opened connection. This approach reduces the latency for data delivery significantly.

The architecture relies on a view of data which is event driven on both sides of the HTTP connection. Engineers familiar with SOA or message oriented middleware will find this diagram to be amazingly familiar. The only substantive change is that the endpoint is the browser.

While Comet is similar to Ajax in that it’s asynchronous, applications that implement the Comet style can communicate state changes with almost negligible latency. This makes it suitable for many types of monitoring and multi-user collaboration applications which would otherwise be difficult or impossible to handle in a browser without plugins.

Why Is Comet Better For Users?

Regular Ajax improves the responsiveness of a UI for a single user, but at the cost of allowing the context to go “stale” for long-lived pages. Changes to data from others users is lost until a user refreshes the whole page. An application can alternately return to the “bad old days” and maintain some sort of state mechanism by which it tells client about changes since the last time they’ve communicated. The user has to either wait until they preform some action which would kick off a request to see the updated state from other users (which might impact the action they wanted to preform!) or request changes from the server at some interval (called “polling”). Since the web is inherently multi-user, it’s pretty obvious that regular Ajax imposes usability and transparency hurdles for users. Applications that employ the Comet technique can avoid this problem by pushing updates to all clients as they happen. UI state does not go out of sync and everyone using an application can easily understand what their changes will mean for other users. Ajax improves single-user responsiveness. Comet improves application responsiveness for collaborative, multi-user applications and does it without the performance headaches associated with intermittent polling.

But Does It Scale?

New server software is often required to make applications built using Comet scale, but the patterns for event-driven IO on the server side are becoming better distributed. Even Apache will provide a Comet-ready worker module in the upcoming 2.2 release. Until then, tools like Twisted, POE, Nevow, mod_pubsub, and other higher-level event-driven IO abstractions are making Comet available to developers on the bleeding edge. Modern OSes almost all now support some sort of kernel-level event-driven IO system as well. I’ve even heard that Java’s NIO packages will start to take advantage of them in a forthcoming release. These tools are quietly making the event-driven future a reality. This stuff will scale, and most of the tools are in place already.

I’ll be giving a more on this topic at ETech and describing the various techniques that Comet applications can employ to push data from the server to the client. As always, I’ll post the slides here as well.

The future of the read-write web is multi-user. There is life after Ajax.

Endnotes

First, a word on terminology and its importance. “Ajax” was coined to describe background request/response data transfer. Many of us had worked on solutions to do exactly this, but it wasn’t until a simple name and accompanying description were provided that it was possible for people not directly building applications to describe what it was they liked about it. Common terminology acts not only as a shortcut in discussions between technical folks, but also as a bridge for those who may not be able to give a technical rundown of exactly how it works.

As with Ajax, those of us who build technology are now faced with another communication challenge. We have a hard problem for which solutions are available (and have been for some time) but no way to communicate about them. Terminology is again the missing link. Today, keeping an HTTP connection open for doing low-latency data transfer to the browser has no digestible name. When I describe a cool new hack, there’s nothing to associate it with. When people say “how the hell did they do that?”, we don’t have a compact answer. Therefore, in the spirit of improved communication (and not technology invention), I’m proposing a new name for this stuff.

Next, for those who are network-level programmers or are familiar with sockets and/or basic TCP/IP programming, you will probably scoff at the concept of web applications finally getting this kind of datagram packet support. Fair enough. It is however interesting to note that while more responsive UIs have been available on a variety of platforms to date, the Web has “won” the broad majority of market share for most classes of applications in which the browser provides enough native (non-plugin) support to make the performance and/or UI feasible. Comet may be a new name for an old set of concepts wrapped in some pretty grotty hacks, but that in no way diminishes the market impact it will have (and is already having).

Lastly, as current Dojo users might expect, Dojo already supports Comet via dojo.io.bind(). More than a year ago we designed the API with Comet in mind. In the next couple of weeks I’ll be showing how bind’s pluggable transport layer can be combined with Dojo’s event topic mechanism to provide message delivery on top of a message bus.

 
Low Latency 在集群中 Low Latency 应用,The operating systems community has ignored network latency for too long. In the past, speed-of-light delays in wide area networks and unoptimized network hardware have made sub-100μs round-trip times impossible. However, in the next few years datacenters will be deployed with low-latency Ethernet. Without the burden of propagation delays in the datacenter campus and network delays in the Ethernet devices, it will be up to us to finish the job and see this benefit through to applications. We argue that OS researchers must lead the charge in rearchitecting systems to push the boundaries of lowlatency datacenter communication. 5-10μs remote procedure calls are possible in the short term – two orders of magnitude better than today. In the long term, moving the network interface on to the CPU core will make 1μs times feasible. 立即下载

相关推荐

2026.06.15+细节判断+郭熙+(笔记)(郭熙言语高分“十二计”).pdf

2026.06.15+细节判断+郭熙+(笔记)(郭熙言语高分“十二计”).pdf

HTB-Armageddon

HTB-Armageddon

TA不懒,但还没有添加简介 443

高校技术转移办公室人员在推进成果转化时,如何快速识别高质量专利?.docx

高校技术转移办公室人员在推进成果转化时,如何快速识别高质量专利?

HTB- Armageddon

hack the box

qq_53142368的博客 1453

政府科技管理者如何推动高校科研成果精准对接产业需求?.docx

政府科技管理者如何推动高校科研成果精准对接产业需求?

交错并联图腾柱PFC变换器仿真设计(Simulink仿真实现)

内容概要:本文档围绕“交错并联图腾柱PFC变换器”的Simulink仿真实现展开,系统阐述了该高效率功率因数校正(PFC)拓扑的建模、控制策略设计与仿真验证全过程。作为适用于中大功率场合的先进PFC结构,交错并联图腾柱通过降低输入电流纹波、提高功率密度和系统效率,展现出显著优势。文档详细介绍了系统总体架构、主电路参数设计、双闭环控制策略(包括电压外环与电流内环)、PWM调制技术、软启动机制以及仿真结果分析等内容,帮助读者掌握从理论分析到仿真实践的完整开发流程。同时,文档还引入与其他主流变换器拓扑(如LLC、DAB、Vienna整流器等)的对比分析与协同应用场景探讨,体现了其在现代电力电子系统集成化发展中的重要地位。; 适合人群:具备电力电子技术基础知识、熟悉Simulink/Matlab仿真环境,从事电源系统设计、新能源变换器研发等相关工作的研究生、工程师及科研人员(建议具有1年以上相关实践经验)。; 使用场景及目标:① 深入理解交错并联图腾柱PFC变换器的工作原理与高性能控制方法;② 掌握基于Simulink的PFC系统建模与闭环控制器设计流程;③ 通过仿真数据分析系统动态响应与稳态性能,优化控制参数;④ 为后续硬件原型开发提供可靠的理论依据与前期验证手段。; 阅读建议:建议结合文档配套的Simulink仿真模型进行逐步操作,重点聚焦于双闭环控制结构设计与PI参数整定环节,深入理解各模块间的耦合关系。同时,可参考文中提及的Vienna、LLC等其他典型拓扑,开展横向对比研究,全面把握不同类型PFC架构的技术特点与适用边界。对于初学者,建议先夯实Buck/Boost电路基础与PWM控制原理,再进入本主题的深入学习。

长连接服务器应用协议(comet)协议了解

本备忘录状态<br />This document specifies a protocol for the Internet community, and requests discussion and suggestions for improvement. This memo is written in the style and spirit of an IETF RFC but is not, as of yet, an official IETF RFC. Distribution of thi

pusa1234的专栏 2536

产业园区运营负责人如何利用AI技术精准识别和推荐适合的科技成果?.docx

科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。

WebSockets与Bayeux/CometD

此时有两种技术可以将通信引入基于浏览器的应用之中:Bayeux(又称CometD)和WebSockets。究竟接下来会是一方被另一方所取代,还是双方藉由显著的差异化实现共同发展呢?\u0026#xD;\nCometD框架是Bayeux协议的实现,可以使得服务器端和客户端在不可靠的网络上进行多通道异步通信。该实现用到了多种语言(JavaScript、Java、Perl等等),但是主要还是基于浏览器的...

啊啊啊啊2 630

VS2022离线环境下的NuGet包管理:从本地源到依赖项全解析

本文详细解析了在VS2022离线环境下如何高效管理NuGet包,包括搭建本地NuGet源的两种方案(本地文件夹源和私有NuGet服务器)、获取离线包的三大渠道以及依赖项处理的实战技巧。通过自动化脚本和依赖树分析工具,帮助开发者解决离线环境中的依赖项黑洞问题,提升开发效率。

5f4d3s2a1q的博客 1060

DVWA靶场实战:手把手教你绕过文件上传限制,用蚁剑连接一句话木马

本文详细介绍了在DVWA靶场中如何绕过文件上传限制并利用蚁剑连接一句话木马的实战技巧。通过分析文件上传漏洞原理、创建一句话木马、使用Burp Suite拦截修改请求以及配置蚁剑连接WebShell的全过程,帮助安全研究人员深入理解Web安全防护与攻击技术。

weixin_30335575的博客 90

Cookie设置HttpOnly属性

在Servlet 3.0中增加对Cookie(请注意,这里所说的Cookie,仅指和Session互动的Cookie,即人们常说的会话Cookie)较为全面的操作API。最为突出特性:支持直接修改Session ID的名称(默认为“JSESSIONID”),支持对cookie设置HttpOnly属性以增强安全...

weixin_34356138的博客 3551

告别串口升级!手把手教你为STM32H750的W25Q32制作MDK下载算法(QSPI篇)

本文详细介绍了为STM32H750的W25Q32制作MDK下载算法(QSPI篇)的完整流程,帮助开发者告别低效的串口烧录方式。通过定制下载算法,可实现20倍以上的烧录速度提升,支持完整的调试功能,显著提高开发效率。文章涵盖环境准备、核心算法实现、性能优化及常见问题解决方案,适合嵌入式开发者参考。

weixin_30735745的博客 403

Servlet 3.0笔记之会话Cookie设置相关 java.lang.NoSuchMethodError: javax.servlet.http.Cook

源:http://www.blogjava.net/yongboy/archive/2011/01/19/346200.html 评: java.lang.NoSuchMethodError: javax.servlet.http.Cookie.setHttpOnly(Z)V 使用tomcat6 转换为7 即可 ------- 在Servlet 3.0中增加对Cookie(请注意,这里...

mauersu 935

python:实现brutefore破解wifi(附完整源码)

python:实现brutefore破解wifi(附完整源码)

希望我的博客,能帮上你解决学习中工作中所遇到的问题 5717

BES 平台 SDK之 美格信Dongle 连接

最近项目到了试产阶段,需要用到美格信的Dongel 来测试ANC 相关功能。在此简单介绍下如何连接Dongel 的操作步骤。

谢文浩博客 926

大数据Spark(八十五):Stage及Spark计算模式

本文详解Spark中Stage的划分机制与Pipeline计算模式。Stage依据RDD宽依赖(Shuffle)划分为ShuffleMapStage和ResultStage,同一Stage内通过迭代器串联多个RDD,实现数据内存流转,减少落盘开销,提升效率。并行度由最后一步RDD的分区数决定,可通过Shuffle算子调优。结合SparkUI可直观分析性能瓶颈,是优化作业的关键基础。

Lansonli(蓝深李)的博客 772

API Streaming Failed 400 <400>InternalError.Algo.InvalidParameter input content must be a string解决方案

本文主要介绍了API Streaming Failed 400 <400> InternalError.Algo.InvalidParameter input content must be a string解决方案,希望能对使用vscode中cline的同学们有所帮助。 文章目录 1. 问题描述 2. 解决方案

weixin_43178406的博客 3万+
上一篇: Comet (Server Push)
下一篇: JDK6新特性之Compiler
chenm
博客等级 码龄25年 1粉丝 8原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值