Re: shell_exec - asynchronous would be cool!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



German Geek napsal(a):
Hi all,

A while ago, i had a problem with shell_exec:

I was writing some code to execute imagemagick to convert a bunch of images.
This could take ages to execute and the page therefore ages to load. The
solution was to get a linux box and append a & at the end to do it in the
background or make a ajax call to a page that does it in batches. The
problem was really that i had to write a file that is then checked against
to know when it was finished... Not very pretty.

Anyway, would it be possible to make a "new" shell_exec_async function in
php that just starts the process, puts it to the background and calls a
callback function or another script with parameters when it finishes? I
guess a callback function is not really going to work because the page needs
to finish execution. It should be possible with PHP forking though.

Anyway, just an idea.

Regards,
Tim

Tim-Hinnerk Heuer

http://www.ihostnz.com
Emo Philips  - "I was the kid next door's imaginary friend."


I would exec a script on linux (=> multi-thread).
That script would do anything what is needed (imagemagick) and then check if there are any processes running on the same session. If NOT than it would call (could be HTTP request also) a PHP script on the windows server.

What's the deal?

Martin

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux