First, I am not looking for ignore_user_abort.
Instead, I look for a function to finalize the output and send the document to the user. After that, I’d like the php script to do additional process which takes another seconds without effects for the user, only background process.
There is no reason for the user to wait for this to be completed, too. The output is ready for catch up before already. Does PHP provide a feature for closing the connection to the user, but remain for a while on the server to complete the work?
One of the best features of php-fpm You is fastcgi_finish_requests(). This will finish the session for the client side and continue the process at serverside.
It’s also best use-case for messaging as an alternative for queque or delayed processing by cron.
However, it’s restricted to php-fpm!