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

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
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 (Scribe) 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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1082928]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2014-12-29 05:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (184 votes), past polls