getTimeout() public method

public getTimeout ( ) : integer
return integer
Example #1
0
 /**
  *
  * @return boolean
  */
 public function isTimeout()
 {
     if (!$this->config->isTimeoutEnabled()) {
         return false;
     }
     $duration = \microtime(true) - $this->getStartTime();
     return $duration > $this->config->getTimeout();
 }
Example #2
0
 /**
  * @dataProvider dataProvider_isTimeoutEnabled
  */
 public function testTimeout($timeout, $expectedEnabled, $expectedTimeout)
 {
     $func = function () {
         exit;
     };
     $configData = array('worker' => $func, 'quantity' => 10);
     if (!\is_null($timeout)) {
         $configData['timeout'] = $timeout;
     }
     $config = new Config($configData);
     $this->assertTrue($expectedEnabled === $config->isTimeoutEnabled());
     $this->assertEquals($expectedTimeout, $config->getTimeout());
 }