[Twisted-web] Using Twisted Web for browser-based control

Jean-Paul Calderone exarkun at divmod.com
Sat Dec 17 22:37:02 MST 2005

On Sun, 18 Dec 2005 00:23:18 -0500, Drake Smith <drakesmith at adelphia.net> wrote:
>At 04:03 PM 12/17/2005 +0200, you wrote:
>>* Drake Smith <drakesmith at adelphia.net> [2005-12-17 08:08:40 -0500]:
>> > I use Twisted Web on an embedded Linux device to provide browser-based
>> > configuration & control. The browser displays a bar graph of a parameter
>> > that is quickly changing on the embedded device (peak audio level). In
>> > order to provide a reasonable feedback to the user, the browser connects 
>> > the Twisted Web CGI server once a second via XMLHTTPRequest to obtain an
>> > updated bar graph level, then Twisted Web dutifully closes the 
>> > Is there a way to achieve the same thing without opening & closing a
>> > connection each time?
>>Yes. The easiest way would be to use something like nevow.athena, which
>>takes care of the XHR connection for you, allowing you to concentrate on
>>the higher-level communication between browser and server.
>>mithrandi, i Ainil en-Balandor, a faer Ambar
>Tristan, thank you for pointing out nevow.athena -- I did not know of it. I 
>did know
>of livepage but I was hoping for something less involved. On the other hand, 
>ability to freely communicate back and forth between browser and server 
>the need for a plug-in is so important that I'm willing to take the plunge 
>into nevow.
>Kindly let me know if there is any documentation on athena other than the
>athena.py and .js modules that reside in the nevow 0.6.0 release, otherwise 
>I will
>find my way through the source and Twisted-web archives.

There is a handful of examples in current trunk at HEAD, in examples/athenademo/.  Note that the API in 0.6 is not quite the same as the API in current trunk.  If you're going to use Athena, I recommend tracking development, rather than sticking to the latest release (at least until the next release, after which things should settle down quite a bit).

Also note that Athena opens and closes a lot of sockets.  I am not sure why this might matter, but you seemed to indicate it was a problem in your initial post, so I wanted to point it out before you got too deep into anything.


More information about the Twisted-web mailing list