Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: apache2 and system

by nite_man (Deacon)
on Sep 28, 2004 at 07:04 UTC ( [id://394478]=note: print w/replies, xml ) Need Help??


in reply to apache2 and system

I'm not quite sure that I understand why do you want execute foo from web page. But if you need to exec some long running operation from your web page you can do it by following algorithm:

  • Create job queue (in the database, for example)
  • Run foo by cron (every minute, for example)
  • In your web page you just create new task with all needed parameters and store it the queue
  • When foo find out uncompleted task it will process that task and store result code
I use this approach to send emails, copy result files to other servers (it's difficult to copy file using SSH via HTTP, for example).
Also, to improve processing of task you can use count of unsuccessful results and exclude from process list tasks which exceeded some limit.

---
Michael Stepanov aka nite_man

It's only my opinion and it doesn't have pretensions of absoluteness!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-04-25 21:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found