Return页面到客户端,并做最后的IO阻塞操作

Return the page to the client, and do a final IO blocking operation

使用 PHP 生成页面时:

<?php
echo "Hello world";
// generate the HTML output
// HTML finished here
send_output_to_client();       // <-- how to do this?

perform_blocking_IO_operation();      // this can last 100 ms or more, this will not output anything anymore, 
                                      // only internal logging IO operations
?>

如何要求 PHP 将输出发送到客户端并且 不要等待 perform_blocking_IO_operation() 完成

由于 perform_blocking_IO_operation() 可以持续 100 毫秒或更长时间,我想避免客户端不必要的等待时间。

使用上面提到的冲洗或 RabbitMQ。