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 web application framework built in Python with Comet support through a feature called Athena. Athena includes both server-side classes and a client-side library to implement Comet -communication.

As with the emergence of Ajax solutions, server-side Comet solutions are being released more and more frequently. Be sure to investigate appropriate solutions for your server architecture before implementing Comet for your web application.

NOTE

You should not implement Comet-style interactions on any web application without first talking to the people in charge of your server system. Make sure that they understand what you are trying to accomplish so that an accurate assessment can be made for server needs.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset