Skip to content

Commit

Permalink
[Process] clarify idle timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobion committed Jan 21, 2014
1 parent 783a45d commit 9f07b4d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/Symfony/Component/Process/Process.php
Expand Up @@ -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
*/
Expand All @@ -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.
*
Expand All @@ -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.
*
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 9f07b4d

Please sign in to comment.