Menu

Progressive display -- small hack towards it

Not ME
2000-08-11
2000-08-15
  • Not ME

    Not ME - 2000-08-11

    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>

     
    • Sam Tregar

      Sam Tregar - 2000-08-15

      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

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.