示例#1
0
 /**
  * @throws \UnderflowException
  * @return \NetBox\ProxyManager\Proxy\Proxy
  */
 public function select()
 {
     $proxy = parent::select();
     if (!is_null($proxy->getUsedAt())) {
         $delta = time() - $proxy->getUsedAt();
         if ($delta < $this->timeout) {
             $sleepSeconds = (int) ($this->timeout - $delta);
             sleep($sleepSeconds);
         }
     }
     return $proxy;
 }
示例#2
0
 public function testSelectExceptionHasRightMessage()
 {
     $this->setExpectedException('UnderflowException', 'No proxies in list');
     $this->object->select();
 }