Is it possible in PHP, to send the data right now to the client, and continue the PHP processing (that might be blocking) ?
<?php
// some code
echo json_encode(array('ok' => '1')); // the client is waiting for this AJAX answer !!
// how to send the response right now before finishing this PHP file ?
// the output is REALLY finished here, so client, you can work with it
some_blocking_processing(); // this is just some server processing that would
// block the client for ~ 5 seconds
// but it produces no output useful for client
?>
I know the right way might be to use queues or other process to perform the processing.
But just as a general purpose question, is it possible to send the data to the client, in the middle of a PHP file?