Beispiel #1
0
 /**
  * This blocks until a particular request is complete.
  *
  * @param T_Curl_Request $request  request to wait on
  * @return T_Curl  fluent interface
  */
 function waitFor(T_Curl_Request $request)
 {
     $key = (string) $request->getHandle();
     if (!$this->isKey($key)) {
         $msg = "No queued CURL request with key {$key}";
         throw new T_Exception_Curl($msg);
     }
     while (!$this->ping($request)) {
         usleep(50);
         // pause before trying again
     }
     return $this;
 }