
On Fri, 2001-11-23 at 16:55, Chris Armstrong wrote:
Ok, riddle me this, glyph (or anyone else who knows about this). Why do we need Deferreds to be a special-case in WebWidgets? Why can't _all_ widgets be displayed only right when they're needed? RenderSession could just take a Widget, and display() it (and the widgets that display() returns) in order.. Is there some sort of performance issue here, maybe?
Maybe I'll try implementing this, and send a patch to be looked at.
Well, I've spent some time trying to implement this, but I'm having some problems. Here's a patch. Notice the 'renderSession' (now-module-level) function and the flatWrite function. flatWrite is the _only_ place where display() is called now, and the data is written as soon as it comes to it. There is a problem, however, with a small test I did. I made a widget that returned a list of 3 widgets: widgets.Time(), SleepWidget(), widgets.Time(). The only thing SleepWidget has is a display() method that sleeps for 2 seconds and returns [], to simulate blocking. I try to render this widget with the new system, but I don't get any content until the entire request is finished. I put in some log messages to say exactly when the writes are happening, and the first widgets.Time() is definitely being written to the request before the SleepWidget is being displayed, but i still don't see anything until the entire request is done. *sigh*, I'm sure that I'm completely off-track here. Why do I always try to rewrite everything I come across that I don't understand? (remember explorer, Kevin?) :P -- <dash> the program isn't debugged until the last user is dead -- Chris Armstrong <<< radix@twistedmatrix.com >>> http://twistedmatrix.com/users/carmstro.twistd/