Image upload script to start other tasks to free up UI
<p>I have an Android application that provides image upload functionality.  When a user selects a photo the app initializes a php script on a remote server - while the image is uploading there is a progress dialog giving feedback to the user.  The upload script is performed in an AsyncTask.</p>

<p>Currently the php processing script pseudoprocess is:</p>

<pre><code>do some house keeping
upload image
image modifications (thumbnails, rotate)
send out push notifications
exit
</code></pre>

<p>Upon exit, the UI is freed up and the user has access to the uploaded image.</p>

<p>My question is in my script can/should I be doing the image modifications and push notifications outside this script?  And if so how?  In the Android Java I would start a background task, but is there someway to do this in PHP - and I don't mean by calling another script separately or cron jobbing something.</p>

<p>I mean something like:</p>

<pre><code>do some housekeeping
upload image
php call background task for modifications
php call background task for push
exit
</code></pre>

<p>So in that example the user interface would be finished processing, but the server may still be doing some stuff on the image.  </p>
