Just another Perl shrine | |
PerlMonks |
Long CGI process is cut short by browserby C_T (Scribe) |
on Dec 02, 2004 at 22:48 UTC ( [id://411982]=perlquestion: print w/replies, xml ) | Need Help?? |
C_T has asked for the wisdom of the Perl Monks concerning the following question:
I have a CGI which uses open3 to call a potentially very lengthy process (data processing). Since open3 doesn't return any output of the process until it completes, the problem I'm running into is that my CGI script spins for a while (~5 minutes?) then times out saying "could not open this page".
I know from experience that I can prevent this if I throw some stuff to the browser periodically, even if it's just a "." character. However I don't know if it's possible to do this while open3 is waiting around. Unfortunately, I can't just background the process and move on because what follows depends on the lengthly process being done. It would be an easy problem to solve in a multi-threaded language (like Java). I would just create a thread to print "." to the browser every 15 seconds or so. However, I'm not sure how to do that in Perl, or if it's even possible. Does anyone have any thoughts to save my script? I'm open to any suggestions, not just a multi-threaded approach. Thanks! CT
Charles Thomas Madison, WI
Back to
Seekers of Perl Wisdom
|
|