in reply to Execute with No wait

One solution, if you do not want to wait for the response, is to send a confirmation page that the script received the request. Once the script has received the request and sent the confirmation page, send all output to a file and not to STDOUT.

You can still test the resulting files vs. messages (but not to the client). If the test passes, the script can then send an email to the user's email address (this would have to be in the form?).


Another solution could be to send characters(maybe ' 's or '.'s), at intervals to the client. This could help overcome the timeout issues as well. If this aproach were taken, immediately send about 256 whitespace characters to overcome any buffers that may be in the server (or client). I have used this approach, along with '$|=1' to overcome timeout issues.

While there may be other/better solutions, I hope this helps.

Mick

Replies are listed 'Best First'.
RE: Re: Execute with No wait
by merlyn (Sage) on Aug 24, 2000 at 23:30 UTC

      Actually, that behavior depends on the Webserver and OS. As I recall you can close STDOUT and STDERR under Apache on a Unix'ish box and Apache will dump the other end. Tho a quick test reveals that it also kills the cgi too so it is of little use to the original poster =)

      Does anyone remember if there is a way to make Apache leave the child alive after closing the connection? I have spent too much time in mod_perl so I may have that on the brain.

      --
      $you = new YOU;
      honk() if $you->love(perl)

      merlyn, I'm starting to get the picture. Please see my post below.
RE: Re: Execute with No wait
by bp (Novice) on Aug 24, 2000 at 23:18 UTC
    So far this (these) seem to be the best possible solutions. Others seem to agree. I'd most be interested in the first choice. The 'work' script has a content-type of text/plain. I'm not sure how to go about adjusting STDOUT but this seems to be on the right track.