src/Model/Table/QueuedJobsTable.php
public function getProcesses($forThisServer = false) {
		/** @var \Queue\Model\Table\QueueProcessesTable $QueueProcesses */
		$QueueProcesses = TableRegistry::getTableLocator()->get('Queue.QueueProcesses');
		$query = $QueueProcesses->findActive()
			->where(['terminate' => false]);
		if ($forThisServer) {
			$query = $query->where(['server' => $QueueProcesses->buildServerString()]);
		}

		$processes = $query
			->enableHydration(false)
			->find('list', ['keyField' => 'pid', 'valueField' => 'modified'])
			->all()
			->toArray();

		return $processes;
	}
public function getProcesses($forThisServer = false) {
		/** @var \Queue\Model\Table\QueueProcessesTable $QueueProcesses */
		$QueueProcesses = TableRegistry::getTableLocator()->get('Queue.QueueProcesses');
		$query = $QueueProcesses->findActive()
			->where(['terminate' => false]);
		if ($forThisServer) {
			$query = $query->where(['server' => $QueueProcesses->buildServerString()]);
		}

		$processes = $query
			->enableHydration(false)
			->find('list', ['keyField' => 'pid', 'valueField' => 'modified'])
			->all()
			->toArray();

		return $processes;
	}
public function getProcesses ( $ forThisServer = false ) { /** @var \Queue\Model\Table\QueueProcessesTable $QueueProcesses */ $ QueueProcesses = TableRegistry :: getTableLocator ( ) -> get ( 'Queue.QueueProcesses' ) ; $ query = $ QueueProcesses -> findActive ( ) -> where ( [ 'terminate' => false ] ) ; if ( $ forThisServer ) { $ query = $ query -> where ( [ 'server' => $ QueueProcesses -> buildServerString ( ) ] ) ; } $ processes = $ query -> enableHydration ( false ) -> find ( 'list' , [ 'keyField' => 'pid' , 'valueField' => 'modified' ] ) -> all ( ) -> toArray ( ) ; return $ processes ; }
Gets all active processes.

$forThisServer only works for DB approach.

@param bool $forThisServer
@return array
Gets all active processes .