/** * @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; }
public function unSelectAll() { parent::unSelectAll(); $this->sortList(); }
public function testUnSelectExceptionHasRightMessage() { $this->setExpectedException('OutOfBoundsException', 'This proxy not in list: "127.0.0.1:80@http"'); $proxy = new Proxy('127.0.0.1:80'); $this->object->unSelect($proxy); }