Example #1
0
 /**
  * @param Request $req
  * @param bool $checkMultiAdd
  * @param bool $force
  * @return bool
  * @throws TransportException
  */
 public function addQueLoop(Request $req, $checkMultiAdd = true, $force = false)
 {
     $id = $req->getId();
     if (!$id) {
         $id = $req->getUniqHash($this->completedRequestCount);
     }
     if (!$force && isset($this->pendingRequests[$id])) {
         if (!$checkMultiAdd) {
             return false;
         }
         throw new TransportException("Cant add exists que - cant overwrite : {$id}!\n");
     }
     $this->pendingRequests[$id] = $req;
     return true;
 }