I am workin on local windows computer with Xampp. I am working on a project which can have thousands of clients. And many of the clients can call an ajax request at the same point of time.
Things are as : from my test.php page an Ajax call is made and the scrip.php is executed slowly, since the sleep(3) function had been implemented within the script various times.
Now when i open the test.php from another browser/client and make an ajax call form this client/browser the previous execution is terminated and the new execution starts.
Script.php
<?php
if($_SERVER['REQUEST_METHOD'] == 'POST')
{
while($varify_user_data)
{
//Creating New Data/Files
sleep
}
}
?>
How do i block all new request until the current execution is finished. And queue all new request. In the server.