continuously updating page
Zak Burke <[email protected]>
| Newsgroups | gmane.comp.web.webobjects.devel |
|---|---|
| Message-ID | <[email protected]> |
The toy Perl script attached below will create a page that continuously
adds new content to the response as it is being generated. I'd like to
do something similar in WO. This is different than a WOLongResponsePage
because it doesn't do a meta-refresh to grab new data; it simply keeps
adding to the response as more data is available.
I couldn't figure out how to do something similar in WO because super is
called at the *end* of your appendToResponse method, which means you
wind up waiting for your long-running-process to complete before sending
the data, which is exactly what I'm trying to avoid. I want to append to
the response continuously as new data is available.
TIA,
zak.
#!/usr/local/bin/perl
$|++; # unbuffer standard out for continuous feedback
print "Content-type: text/html\n\n";
for (1..10)
{
print "new item<br />";
sleep 1;
}