getTermTimeout() public method

public getTermTimeout ( ) : float
return float
コード例 #1
0
ファイル: ProcessStub.php プロジェクト: comos/qpm
 protected function dealWithTermTimeout()
 {
     if ($this->isDealedWithTermTimeout) {
         return false;
     }
     if (microtime(true) - $this->termTime <= $this->config->getTermTimeout()) {
         return false;
     }
     try {
         Logger::info("process[" . $this->getProcess()->getPid() . "] will be killed for termTimeout");
         $this->getProcess()->kill();
         $this->isDealedWithTermTimeout = true;
     } catch (\Exception $e) {
         Logger::err($e);
         return false;
     }
     return true;
 }
コード例 #2
0
ファイル: ConfigTest.php プロジェクト: comos/qpm
 /**
  * @dataProvider dataProviderOfTermTimeout
  */
 public function testTermTimeout($termTimeout, $expectedIsKillOnTimeout, $expectedTermTimeout)
 {
     $config = new Config(array('termTimeout' => $termTimeout, 'worker' => function () {
     }));
     $this->assertEquals($expectedTermTimeout, $config->getTermTimeout());
     $this->assertEquals($expectedIsKillOnTimeout, $config->isKillingOnTimeoutEnabled());
 }