Re: How to handle actions that may take a long time?

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

 



Cajus Pollmeier wrote:
> I'd like to know your opinion about how to handle events that may take
> more than a minute to finish in PHP. In this case,  the code is
> performing a recursive action on a large LDAP tree where I'd like to
> present something like a status page ("Please wait, blah blah" with
> some animated gif or so), while the action takes place in background.
>
> Is it possible to fork away this PHP code and set some SESSION vars to
> trigger the end of the status page? Or do I have to put this action
> behind a one pixel image and act when the page is "really" complete?
> Also I'm not sure how to handle the script execution timeout problem...

Do you really expect the user wants to sit there for all the time waiting
for the process to finish?

Is there ANY way to factor out that code and do it before they get there? 
Obviously not for a search where the user types in what they want, but is
that what you are doing?  You don't say; I can't guess.

Basically, if I have to sit there waiting, then I'm not really all that
impressed with an animated gif or whatever...

Perhaps you have them logged in already, and you could record their search
parameters and assign it an ID, and perform the search in the background,
and then have a page to deliver the results to later.

In other words, let me start up a couple searches, go do something else,
and come back later for my answers if I can't have them RIGHT NOW.

The web is all about RIGHT NOW :-)

There are a lot of possible answers, really, but unless you provide
context for the rest of your application and how the LDAP search fits in,
we can't give you much.

-- 
Like Music?
http://l-i-e.com/artists.htm

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