Re:HtmlGenerator will improve in next version?

Alexandre Rafalovitch writes:
 > > BTW if anyone looks more
 > >closely into this (eg writes code), then be sure to make your
 > >generator emit code as soon as possible: one of the trouble with the
 > >current HtmlGenerator is that it will require you to internally
 > >generate *all* the document before you can actually send something. If
 > >the generated doc is to be huge, this is likely to be a real
 > >problem. (it should be friendly to Piped*Stream for example)
 > 
 > Can you elaborate on this early emit issue. The way I saw it should be,was
 > actually to keep from emitting code for as long as possible, so all filters
 > would have a chance to have a go at it. Or do you mean later stage???
 > If the explanation is long, it might even deserve a separate thread. (eg.
 > Timing issues in Jigsaw :-} )

Jigsaw core, will startemiting the reply stream as soon as it gets
it. For example, when you run a CGI script, what really happens is the
following

(client) (jigsaw core) (pump) (cgi)

As soon as the CGI process is started, the "pump" is put in place and
reads data from the script that it feeds back to the corem which in
turn sends it to the client. This allows CGI script output  to be
visible by the client before the cgi script has ended. 

The current HtmlGenerator would first build a big Byte stream of the
html, and give this stream to the core, while what you really want is
to be able to start emiting the generated html as soon as possible (so
that the clients sees it). To do this you can use a pump similar to
the one use in CGI scripts, namely PipedIO streams. This doesn affect
the remaining filters in the chian since they will act as another
(passive) pump.

Hope this helps, it might not ;-)
Anselm.

Received on Thursday, 22 August 1996 22:02:16 UTC