The MVC (model-view-controller) framework is used in the application. The client (an iOS App) and the server use the http protocol to communicate.
The function is called upload_data which is defined in the model file named profile.model.php. When this function is called, I would like it to simply return a successful message to the client first, and then calls another function process_data to handle time-consuming tasks such as reading data from and writing data to the database.
<?php
      function upload_data($data){
          // simply returns a successful message to the caller
      }
      function process_data($data){
         // handles time-consuming tasks
      }
?>
I just wonder what is the best way to do it. Thanks.
 
    