Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can't execute an external php-file (that is actually make a new http-request) in parallel to existing request-response flow. There exist 2 possible solutions.</p> <ol> <li><p>You can implement a task queue on your server (usually a dedicated table in DB), so while processing a request by <code>file1.php</code> you should add new task in the queue. In parallel to main web-server process, you should have a php "daemon" always running, which looks for new tasks and processes them in background (fetches required details by <code>file2.php</code>). Once a task is ready (or a part of it, for example several first records with details are available), mark it appropriately in the queue. Android app should periodically check new details and load them using another access point (say <code>file3.php</code>), which returns available details from partially or completely executed task. I don't know which server-side framework do you use (if any), but some of them provide "batch jobs" based on <code>cron</code>. This looks not as easy to go way though. Most appropriate method would be to use <a href="https://stackoverflow.com/questions/5452779/php-push-notifications">push notification</a>, that is the server should notify your client about new available details for items in the list already sent to the client.</p></li> <li><p>You can move part of control logic into the Android app. This way it requests a list of objects, then in a loop send new requests for object details, which are proxied to Google Places by means of <code>file2.php</code>. In other words, <code>file2.php</code> is executed by client instead of the server.</p></li> </ol> <p>In addition, you should possibly look at some server-side tools other than php, for example <a href="http://nodejs.org/" rel="nofollow noreferrer">Node.js</a>, which is much better suited for implementing <a href="http://en.wikipedia.org/wiki/Push_technology#Long_polling" rel="nofollow noreferrer">long polling</a> and <a href="http://en.wikipedia.org/wiki/WebSocket" rel="nofollow noreferrer">websockets</a> (choose one of them).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload