Re: continue working after finishing up with the http client
| From: | Carsten Wiedmann | Date: | Wed, 27 May 2009 18:55:19 +0000 |
| Subject: | Re: continue working after finishing up with the http client | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-293243@lists.php.net to get a copy of this message | ||
Tom Worster schrieb:
> 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
| <?php
| function callback($buffer) {
| header('Content-Length: '.strlen($buffer));
| header('Transfer-Encoding : identity');
| header('Connection: close');
| return($buffer);
| }
| ob_start('callback');
|
| /*
| * Steps 1-3
| */
|
| while (@ob_end_flush());
|
| /*
| * Step 4
| */
| ?>
Regards,
Carsten