Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Process.php

function Process::checkTimeout

Performs a check between the timeout definition and the time the process started.

In case you run a background process (with the start method), you should trigger this method regularly to ensure the process timeout

Throws

ProcessTimedOutException In case the timeout was reached

4 calls to Process::checkTimeout()
Process::getIterator in vendor/symfony/process/Process.php
Returns an iterator to the output of the process, with the output type as keys (Process::OUT/ERR).
Process::start in vendor/symfony/process/Process.php
Starts the process and returns after writing the input to STDIN.
Process::wait in vendor/symfony/process/Process.php
Waits for the process to terminate.
Process::waitUntil in vendor/symfony/process/Process.php
Waits until the callback returns true.

File

vendor/symfony/process/Process.php, line 1173

Class

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

Namespace

Symfony\Component\Process

Code

public function checkTimeout() : void {
    if (self::STATUS_STARTED !== $this->status) {
        return;
    }
    if (null !== $this->timeout && $this->timeout < microtime(true) - $this->starttime) {
        $this->stop(0);
        throw new ProcessTimedOutException($this, ProcessTimedOutException::TYPE_GENERAL);
    }
    if (null !== $this->idleTimeout && $this->idleTimeout < microtime(true) - $this->lastOutputTime) {
        $this->stop(0);
        throw new ProcessTimedOutException($this, ProcessTimedOutException::TYPE_IDLE);
    }
}
RSS feed
Powered by Drupal