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

Tommi Virtanen tv at twistedmatrix.com
Sun Dec 18 02:22:05 MST 2005


Drake Smith wrote:
> 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
> to the Twisted Web CGI server once a second via XMLHTTPRequest to obtain
> an updated bar graph level, then Twisted Web dutifully closes the
> connection. Is there a way to achieve the same thing without opening &
> closing a connection each time?

AJAXy things in nevow.athena may be attracting to you, as pointed out
elsewhere. If you for some reason don't want to use them, the old school
way is to have the bar graph as a GIF with more than one frame, and
stream the frames whenever you want to update the picture; that keeps
a single connection open to the server, pushing more data exactly when
you want to. Of course, it is limited to updating 1-4 GIF images.



More information about the Twisted-web mailing list