Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: Will script terminate with window closing

by sundialsvc4 (Abbot)
on Apr 20, 2014 at 01:35 UTC ( #1082928=note: print w/replies, xml ) Need Help??

in reply to Will script terminate with window closing

Personally, I suggest that a CGI script should not carry out long-running activities such as “sending 100 emails.”   To my way of thinking, “a web-page is a user inteface; nothing more.”   If you have something that takes a long time to do, I suggest that you set up some kind of persistent daemon process that is responsible for doing it, and have it (say) listen on a pipe for some instruction ... coming from the web site or what-have-you ... that tells it to start doing it.   All that the web-page needs to do is to confirm to the user that the request has been successfully posted (to the daemon).

The entire notion behind the HTML protocol is that you “submit a request, get a response, then fuhgeddaboudit.” ...
Request => Response ... Finis.
... and, so, that is precisely how I would structure the process that enables the user to request that 100 emails should be sent “real soon now.”   Don’t make him wait for it.   Heck, don’t allow him to wait for it.   That’s not what HTML is for.

  • Comment on Re: Will script terminate with window closing

Replies are listed 'Best First'.
Re^2: Will script terminate with window closing
by Anonymous Monk on Apr 20, 2014 at 11:32 UTC
    ... the HTML protocol...

    You meant the Hypertext Transfer Protocol (HTTP)?

Re^2: Will script terminate with window closing
by htmanning (Pilgrim) on Apr 21, 2014 at 20:23 UTC
    Thanks so much for this response. You're right. I need to figure out a different way to do it.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1082928]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2018-04-25 00:45 GMT
Find Nodes?
    Voting Booth?