public function Process::setTimeout

Sets the process timeout.

To disable the timeout, set this value to null.

Parameters

float|null $timeout The timeout in seconds:

Return value

self The current Process instance

Throws

InvalidArgumentException if the timeout is negative

1 call to Process::setTimeout()
Process::__construct in drupal/core/vendor/symfony/process/Symfony/Component/Process/Process.php
Constructor.

File

drupal/core/vendor/symfony/process/Symfony/Component/Process/Process.php, line 858

Class

Process
Process is a thin wrapper around proc_* functions to ease start independent PHP processes.

Namespace

Symfony\Component\Process

Code

public function setTimeout($timeout) {
  if (null === $timeout) {
    $this->timeout = null;
    return $this;
  }
  $timeout = (double) $timeout;
  if ($timeout < 0) {
    throw new InvalidArgumentException('The timeout value must be a valid positive integer or float number.');
  }
  $this->timeout = $timeout;
  return $this;
}