Supported Versions: PHP 4 >= 4.1.0, PHP 5, PHP 7, PHP 8
Installs a signal handler
pcntl_signal(int $signal, callable|int $handlerbool $restart_syscalls true): bool
        pcntl_signal(SIGALRM, function () use ($job$options) {

            if (
$job) {

                
$this->markJobAsFailedIfWillExceedMaxAttempts(

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

                );



                
$this->markJobAsFailedIfWillExceedMaxExceptions(

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

                
);



                
$this->markJobAsFailedIfItShouldFailOnTimeout(

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

                
);

            }



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

        });



        
pcntl_alarm(

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

        
pcntl_async_signals(true);



        
pcntl_signal(SIGTERM, function () {

            
$this->shouldQuit true;

        });



        
pcntl_signal(SIGUSR2, function () {

            
$this->paused true;
            $this->shouldQuit true;

        });



        
pcntl_signal(SIGUSR2, function () {

            
$this->paused true;

        });



        
pcntl_signal(SIGCONT, function () {

            
$this->paused false;
            $this->paused true;

        });



        
pcntl_signal(SIGCONT, function () {

            
$this->paused false;

        });

    }