It would be way cool to be able to send the result to the web server progressively as the data is acquired; in particular, for slow running SQL query results display.
Unfortunately, the current architecture would not allow it, I have some alternate design in preparation for it, but it's far from there yet.
What I plan to do RSN is to be able to send the beginning of the file UP TO the first dynamic parameter to a given filehandle, so that the user sees that something's coming. This will solve problem such as users cancelling the page download earlier, and will make sites appear snappier.
Example:
my $tmpl = HTML::Template->new(filename=>'template.html', displayto => \*STDOUT);
What do you think?
This is not always desirable, such as in cases where an error could occur; but then, it'd be better to display the beginning, and then have:
The problem with this is that HTML::Template has no way to know when its ok to output a chunk of template until you actually call output(). Unless you place arbitrary restrictions - like no calling param() with the same NAME twice - I don't see how this can work.
-sam
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It would be way cool to be able to send the result to the web server progressively as the data is acquired; in particular, for slow running SQL query results display.
Unfortunately, the current architecture would not allow it, I have some alternate design in preparation for it, but it's far from there yet.
What I plan to do RSN is to be able to send the beginning of the file UP TO the first dynamic parameter to a given filehandle, so that the user sees that something's coming. This will solve problem such as users cancelling the page download earlier, and will make sites appear snappier.
Example:
my $tmpl = HTML::Template->new(filename=>'template.html', displayto => \*STDOUT);
What do you think?
This is not always desirable, such as in cases where an error could occur; but then, it'd be better to display the beginning, and then have:
<TMPL_IF error>
<p>An error has occured!</p>
<TMPL_ELSE>
<TMPL_LOOP results>
<p><TMPL_VAR value></p>
</TMPL_LOOP>
</TMPL_IF>
The problem with this is that HTML::Template has no way to know when its ok to output a chunk of template until you actually call output(). Unless you place arbitrary restrictions - like no calling param() with the same NAME twice - I don't see how this can work.
-sam