Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: apache2 and system

by nite_man (Deacon)
on Sep 28, 2004 at 07:04 UTC ( #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
Node Status?
node history
Node Type: note [id://394478]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2021-06-13 16:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (57 votes). Check out past polls.

    Notices?