Re: continue working after finishing up with the http client

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

 



On 5/27/09 9:50 AM, "bruce" <bedouglas@xxxxxxxxxxxxx> wrote:

> exacly what are you trying to accomplish? is this in a web app? has the user
> hit the site, logged in, etc?
> 
> can you provide an example of what the sequence of events are that you're
> trying to deal with..

it is a web app.

let's say for example that we're processing an ajax query. say we can
normally generate and deliver the response to the client quickly but the
speed depends on a cache with a relatively low miss rate.

now, when we get a cache miss, imagine that generating the client response
from scratch takes significantly less time than generating and inserting the
new cache entry corresponding to the query. so we want to send the response
to the client and then process the cache entry.

without getting into whether or not this cache design makes sense, my
question in this example is: what options are there for ending the http
transition and then continuing on to do the cache update work?
 

> -----Original Message-----
> From: Tom Worster [mailto:fsb@xxxxxxxxxx]
> Sent: Wednesday, May 27, 2009 6:27 AM
> To: php-general@xxxxxxxxxxxxx
> Subject:  continue working after finishing up with the http client
> 
> 
> what options are there to do the following:
> 
> 1. receive request from client (including post data)
> 
> 2. do some work, update the db, prepare output for client
> 
> 3. send output and finish up with the client
> 
> 4. do some more work that might take considerable time, updating the db some
> more
> 
> it would be convenient and efficient if step 4 took place within the same
> process as steps 1-3. but output control seems not to be sufficient:
> ob_flush(); flush(); sends the output but leave the client waiting for more.
> is there a way to close the connection as though exit; were called but
> without quitting the script?
> 
> alternatively the script could start another process, copy over whatever
> data is needed and disconnect from it. but that has its overheads on the
> server.
> 
> are the other possibilities?



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