src/Shell/CakeResqueShell.php
public function pause()
    {
        $ResqueStatus = $this->ResqueStatus;

        $actionMessage = function ($pid) {
            return __d('cake_resque', 'Pausing {0} ... ', $pid);
        };

        $successCallback = function ($worker) use ($ResqueStatus) {
            $ResqueStatus->setPausedWorker((string)$worker);
        };

        // Active workers
        $this->debug(__d('cake_resque', 'Fetching list of active workers'));
        $activeWorkers = CakeResque::getWorkers();
        array_walk($activeWorkers, function (&$worker) {
            $worker = (string)$worker;
        });

        // Paused workers
        $pausedWorkers = $ResqueStatus->getPausedWorker();

        return $this->_sendSignal(
            __d('cake_resque', 'Pausing workers'),
            array_diff($activeWorkers, $pausedWorkers),
            __d('cake_resque', 'There is no active workers to pause ...'),
            __d('cake_resque', 'Active workers list'),
            __d('cake_resque', 'Pause all workers'),
            __d('cake_resque', 'Worker to pause'),
            __d('cake_resque', 'Pausing the Scheduler Worker ... '),
            $actionMessage,
            null,
            $successCallback,
            'USR2'
        );
    }
public function pause()
    {
        $ResqueStatus = $this->ResqueStatus;

        $actionMessage = function ($pid) {
            return __d('cake_resque', 'Pausing {0} ... ', $pid);
        };

        $successCallback = function ($worker) use ($ResqueStatus) {
            $ResqueStatus->setPausedWorker((string)$worker);
        };

        // Active workers
        $this->debug(__d('cake_resque', 'Fetching list of active workers'));
        $activeWorkers = CakeResque::getWorkers();
        array_walk($activeWorkers, function (&$worker) {
            $worker = (string)$worker;
        });

        // Paused workers
        $pausedWorkers = $ResqueStatus->getPausedWorker();

        return $this->_sendSignal(
            __d('cake_resque', 'Pausing workers'),
            array_diff($activeWorkers, $pausedWorkers),
            __d('cake_resque', 'There is no active workers to pause ...'),
            __d('cake_resque', 'Active workers list'),
            __d('cake_resque', 'Pause all workers'),
            __d('cake_resque', 'Worker to pause'),
            __d('cake_resque', 'Pausing the Scheduler Worker ... '),
            $actionMessage,
            null,
            $successCallback,
            'USR2'
        );
    }
public function pause ( ) { $ ResqueStatus = $ this -> ResqueStatus ; $ actionMessage = function ( $ pid ) { return __d ( 'cake_resque' , 'Pausing {0} ... ' , $ pid ) ; } ; $ successCallback = function ( $ worker ) use ( $ ResqueStatus ) { $ ResqueStatus -> setPausedWorker ( ( string ) $ worker ) ; } ; // Active workers $ this -> debug ( __d ( 'cake_resque' , 'Fetching list of active workers' ) ) ; $ activeWorkers = CakeResque :: getWorkers ( ) ; array_walk ( $ activeWorkers , function ( & $ worker ) { $ worker = ( string ) $ worker ; } ) ; // Paused workers $ pausedWorkers = $ ResqueStatus -> getPausedWorker ( ) ; return $ this -> _sendSignal ( __d ( 'cake_resque' , 'Pausing workers' ) , array_diff ( $ activeWorkers , $ pausedWorkers ) , __d ( 'cake_resque' , 'There is no active workers to pause ...' ) , __d ( 'cake_resque' , 'Active workers list' ) , __d ( 'cake_resque' , 'Pause all workers' ) , __d ( 'cake_resque' , 'Worker to pause' ) , __d ( 'cake_resque' , 'Pausing the Scheduler Worker ... ' ) , $ actionMessage , null , $ successCallback , 'USR2' ) ; }
Pause workers.

On supported system, will ask the user to choose the worker to pause, from a list
of workers, if more than one worker is running, or if --all is not passed.

Note: The workers status is conveniently stored by ResqueStatus.

@since 2.0.0
@return void
@see CakeResqueShell::_sendSignal()
@see ResqueStatus\ResqueStatus::getPausedWorker()
@see ResqueStatus\ResqueStatus::setPausedWorker()
Pause workers .