views:

12

answers:

0

Hello there!

try {
            $r->send ();
            echo $r->getResponseBody();
    } catch (HttpException $ex) {
            echo 'Message: ' .$ex->getMessage();
            echo "<h5>No Resutls provided from blah blah for this domain name</h5>  </div>";
    }

I use the HTTPRequest method to do requests to a server that I have implemented in python. My server asks many sources for information and I have also implemented a prefetching mechanism for it. So, some times, when I do request to my server the results are not available due to prefetching (which is asynchronous).. Is there a way to change the php code above, so as when an exception is raised of empty or small response to wait for a small time space e.g. 5 seconds and do the same request again until the response data is available? Is there a way to show a simple loading bar during the waiting time? Thank you in advance, Thanasis