コード例 #1
0
ファイル: CurlMultiProxy.php プロジェクト: Ryu0621/SaNaVi
 protected function getAvailableHandle()
 {
     foreach ($this->handles as $h) {
         if (!in_array($h, $this->groups, true)) {
             return $h;
         }
     }
     $handle = new CurlMulti();
     $handle->setEventDispatcher($this->getEventDispatcher());
     $this->handles[] = $handle;
     return $handle;
 }
コード例 #2
0
ファイル: CurlMultiProxy.php プロジェクト: Trideon/gigolo
 /**
  * Get an existing available CurlMulti handle or create a new one
  *
  * @return CurlMulti
  */
 protected function getAvailableHandle()
 {
     // Grab a handle that is not claimed
     foreach ($this->handles as $h) {
         if (!in_array($h, $this->groups, true)) {
             return $h;
         }
     }
     // All are claimed, so create one
     $handle = new CurlMulti($this->selectTimeout);
     $handle->setEventDispatcher($this->getEventDispatcher());
     $this->handles[] = $handle;
     return $handle;
 }