9.3. Server-Side Support

Although the concept of HTTP streaming brings a lot of exciting possibilities to web applications, there are some concerns. Normal web browser traffic opens a connection, gets the data it needs, and then closes the connection. If every user is connected to a streaming HTTP web application at the same time, that means one connection must be kept alive for every user. On web applications with a large amount of traffic, this means significant server overhead. Plus, leaving infinite loops running on the server necessitates better memory management than typical web application servers provide. Fortunately, there are several server-side solutions designed to enable web servers to handle Comet-style communication.

  • Twisted (http://twistedmatrix.com/trac/): An open source server-side event-publishing framework designed for optimal network usage. Twisted is written in Python and works over a large number of network protocols (not just HTTP). It's worth noting that Twisted wasn't designed specifically for Comet, but its server event paradigm works exceptionally well for the management of HTTP streaming.

  • Pushlets (http://www.pushlets.com): An open source approach to HTTP streaming for JSP application servers. Pushlets use an event-publishing/subscribing model similar to server-sent DOM events to enable client-server communication. The framework comes with both server- and client-side libraries.

  • DivMod: Nevow (http://divmod.org/trac/wiki/DivmodNevow): An open source ...

Get Professional Ajax, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.