Supported Versions: PHP 4 >= 4.1.0, PHP 5, PHP 7, PHP 8
Installs a signal handler
<?php pcntl_signal(int $signal, callable|int $handler, bool $restart_syscalls = true): bool
<?php         foreach ($previousHandlers as $signal => $handler) {

            if (is_null($handler)) {

                pcntl_signal($signal, SIG_DFL);



                unset($previousHandlers[$signal]);

            }
<?php         pcntl_signal(SIGALRM, function () use ($job, $options) {

            if ($job) {

                $this->markJobAsFailedIfWillExceedMaxAttempts(

                    $job->getConnectionName(), $job, (int) $options->maxTries, $e = $this->timeoutExceededException($job)

                );



                $this->markJobAsFailedIfWillExceedMaxExceptions(

                    $job->getConnectionName(), $job, $e

                );



                $this->markJobAsFailedIfItShouldFailOnTimeout(

                    $job->getConnectionName(), $job, $e

                );



                $this->events->dispatch(new JobTimedOut(

                    $job->getConnectionName(), $job

                ));

            }



            $this->kill(static::EXIT_ERROR, $options);

        }, true);



        pcntl_alarm(

            max($this->timeoutForJob($job, $options), 0)
<?php     {

        pcntl_async_signals(true);



        pcntl_signal(SIGQUIT, fn () => $this->shouldQuit = true);

        pcntl_signal(SIGTERM, fn () => $this->shouldQuit = true);

        pcntl_signal(SIGUSR2, fn () => $this->paused = true);

        pcntl_signal(SIGCONT, fn () => $this->paused = false);
<?php         pcntl_async_signals(true);



        pcntl_signal(SIGQUIT, fn () => $this->shouldQuit = true);

        pcntl_signal(SIGTERM, fn () => $this->shouldQuit = true);

        pcntl_signal(SIGUSR2, fn () => $this->paused = true);

        pcntl_signal(SIGCONT, fn () => $this->paused = false);

    }
<?php         pcntl_signal(SIGQUIT, fn () => $this->shouldQuit = true);

        pcntl_signal(SIGTERM, fn () => $this->shouldQuit = true);

        pcntl_signal(SIGUSR2, fn () => $this->paused = true);

        pcntl_signal(SIGCONT, fn () => $this->paused = false);

    }
<?php         pcntl_signal(SIGQUIT, fn () => $this->shouldQuit = true);

        pcntl_signal(SIGTERM, fn () => $this->shouldQuit = true);

        pcntl_signal(SIGUSR2, fn () => $this->paused = true);

        pcntl_signal(SIGCONT, fn () => $this->paused = false);

    }