Permalink
Browse files

[Process] clarify idle timeout

  • Loading branch information...
Tobion committed Jan 21, 2014
1 parent 783a45d commit 9f07b4db254338913409efc652993810fded0cd8
Showing with 9 additions and 7 deletions.
  1. +9 −7 src/Symfony/Component/Process/Process.php
@@ -730,7 +730,7 @@ public function setCommandLine($commandline)
}
/**
* Gets the process timeout.
* Gets the process timeout (max. runtime).
*
* @return float|null The timeout in seconds or null if it's disabled
*/
@@ -740,17 +740,17 @@ public function getTimeout()
}
/**
* Gets the process idle timeout.
* Gets the process idle timeout (max. time since last output).
*
* @return float|null
* @return float|null The timeout in seconds or null if it's disabled
*/
public function getIdleTimeout()
{
return $this->idleTimeout;
}
/**
* Sets the process timeout.
* Sets the process timeout (max. runtime).
*
* To disable the timeout, set this value to null.
*
@@ -768,9 +768,11 @@ public function setTimeout($timeout)
}
/**
* Sets the process idle timeout.
* Sets the process idle timeout (max. time since last output).
*
* @param integer|float|null $timeout
* To disable the timeout, set this value to null.
*
* @param integer|float|null $timeout The timeout in seconds
*
* @return self The current Process instance.
*
@@ -991,7 +993,7 @@ public function checkTimeout()
throw new ProcessTimedOutException($this, ProcessTimedOutException::TYPE_GENERAL);
}
if (0 < $this->idleTimeout && $this->idleTimeout < microtime(true) - $this->lastOutputTime) {
if (null !== $this->idleTimeout && $this->idleTimeout < microtime(true) - $this->lastOutputTime) {
$this->stop(0);
throw new ProcessTimedOutException($this, ProcessTimedOutException::TYPE_IDLE);

0 comments on commit 9f07b4d

Please sign in to comment.