Handling of lengthy server operation in php

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

 



Hi everybody,

I have been trying to find a solution to this issue on other newsgroups but
haven't had any luck so far.

My config: Apache 2.0.54, PHP 5.1.2 on Win XP (or 2003).

Here is the outline of my application:

The user submits a form to the server, which is then processed by a php
script. This script calls exec to start a Win32 console which passes some
information to a Windows process, and then returns, thus allowing the php
script to continue. In the meantime, the service keeps working. When it's
done, it creates a file to signal that new data is available. The php script
sees this file, picks up the data and sends it to the user.

Everytbing works if all this happens synchronously, meaning the php script
waits for the windows service to finish before doing anything else. But this
means that the user doesn't see any feedback as to the status of the
operation (and it can be quite lenghty), and it can't cancel it either. So
in order to increase useability, I need the server needs to be able to
perform some concurrent tasks:
1. monitor the status of the Windows service processing
2. provide user feedback about its status
3. listen for user commands, such as cancel, or back, in order to cancel the
current processing

I tried various ideas, using header( ... ) to start other scripts etc, but
so far nothing worked - things always happen synchronously (start
processing, wait for it to finish, show result) which is not what a user
would expect. Also, I would prefer to do everything on the server instead of
using js for example in the browser.

Any help would be really appreciated.

Thanks,

Adrian

-- 
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