Run job queue.

@param string $queue
485953
public function run($queue)
    {
        $configuration = $this->getConfiguration($queue);
        
        if (null === $configuration) {
            return;
        }

        try {
            $job = $this->getJob($configuration);
            $configuration->increaseOrderNr();

            $this->saveJobState($configuration, JobState::STATE_RUNNING);

            $report = $this->reportManager->create($configuration);
            $state = $job->run($report);

            if (JobState::STATE_FINISHED === $state) {
                $configuration->setNextStart(new \DateTime('+' . $configuration->getPeriod() . ' seconds'));
                $report->setSuccessful(true);
            }

            $report->setEndedAt();

            $this->saveJobState($configuration, $state);
        } catch (JobFactoryException $e) {
            $this->saveJobState($configuration, JobState::STATE_FAILED);
        }
    }
546746
public function deleteReserved($queue, $job)
	{
		$this->redis->zrem($this->getQueue($queue).':reserved', $job);
	}
317409
protected function marshalJob($queue, $job)
    {
        $job = $this->markJobAsReserved($job);

        return new DatabaseJob(
            $this, $job, $this->connectionName, $queue
        );
    }
214684
def run_job(args):
  """"""
  jm = setup(args)
  job_id = int(os.environ['JOB_ID'])
  array_id = int(os.environ['SGE_TASK_ID']) if os.environ['SGE_TASK_ID'] != 'undefined' else None
  jm.run_job(job_id, array_id)
87022
public function run(Job $job /*, Callable $callback=null*/) {
        $this->logger->info('Starting Job: '.$job->id.' | '.$job->command);
        $callback = array($this, 'notifyExecutionEnd');

        $runner = $this->getJobRunner($job);

        if ($this->hasDependency($job)) {
            $job_dep = $this->getDependency($job);

            if ($job_dep->exit_code == self::EXIT_CODE_NORMAL && $this->isValid($job_dep)) {
                $this->logger->info('Job has dependency and his dependency is OK | dependency: '.$job_dep->id . ' | '.$job_dep->command);

                $job->status_code = 1;
                $this->execute($job, $runner, $callback);

            } else if ($this->isRunning($job_dep) || $this->isWaiting($job)) {
                $this->logger->info('Job has dependency and his dependency is working | dependency: '.$job_dep->id . ' | '.$job_dep->command);

                $job->status_code = 4;
                $this->execute($job, $runner, $callback);

            } else {
                $this->logger->error('Job has dependency and his dependency get some error, aborting | dependency: '.$job_dep->id . ' | '.$job_dep->command);

                $job->status_code = 2;

            }
        } else {
            $job->status_code = 1;
            $this->execute($job, $runner, $callback);
        }
    }
291239
public function pop($queue = null)
    {
        $queue = $this->getQueue($queue);

        $response = $this->sqs->receiveMessage(
            array('QueueUrl' => $queue, 'AttributeNames' => array('ApproximateReceiveCount'))
        );

        if (count($response['Messages']) > 0)
        {
            return new SqsJob($this->container, $this->sqs, $queue, $response['Messages'][0]);
        }
    }
273099
public function execute()
    {
        $queue = $this->container->getDelayedExecutionTaskQueue();
        if($queue->length() == 0){
            return;
        }
        ignore_user_abort(true);
        $queue->execute();
    }
1370335
protected function runQueuedOn()
    {
        if (!is_null($method = $this->validationScenarios['on'])) {
            call_user_func_array([$this, $method], $this->validationScenarios['parameters']);
        }
    }
1162738
public function pop($queue = null)
    {
        $queue = $this->getQueue($queue);

        $job = $this->pheanstalk->watchOnly($queue)->reserve(0);

        if ($job instanceof Pheanstalk_Job) {
            return new BeanstalkdJob($this->container, $this->pheanstalk, $job, $queue);
        }
    }
290653
def run_queue(self, options, todo):
    """"""
    utils.logging_debug('AutoBatcher(%s): %d items',
                        self._todo_tasklet.__name__, len(todo))
    batch_fut = self._todo_tasklet(todo, options)
    self._running.append(batch_fut)
    # Add a callback when we're done.
    batch_fut.add_callback(self._finished_callback, batch_fut, todo)
690837
public function unserialize($queue)
    {
        foreach (unserialize($queue) as $item) {
            $this->insert($item['data'], $item['priority']);
        }
    }
763298
public function pop($queue = null)
	{
		$queue = $this->getQueue($queue);

		$response = $this->sqs->receiveMessage(
			['QueueUrl' => $queue, 'AttributeNames' => ['ApproximateReceiveCount']]
		);

		if (count($response['Messages']) > 0) {
			if ($this->jobCreator) {
				return call_user_func($this->jobCreator, $this->container, $this->sqs, $queue, $response);
			} else {
				return new SqsJob($this->container, $this->sqs, $queue, $response['Messages'][0]);
			}
		}
	}
562605
public function setQueue( $queue )
	{
		$this->queue = $queue;

		if ( $this->mailer )
		{
			$this->mailer->setQueue( $queue );
		}

		return $this;
	}
146818
public function merge(self $queue): void
    {
        $data = $queue->toArray();

        foreach ($data as $item) {
            $this->insert($item['data'], $item['priority']);
        }
    }
606446
private function hasRunningJobInQueue($queue)
    {
        $running = $this->configurationManager->findByQueueAndState($queue, JobState::STATE_RUNNING);

        return null !== $running;
    }
1073547
protected function migrateAllExpiredJobs($queue)
    {
        $this->migrateExpiredJobs($queue . ':delayed', $queue);

        $this->migrateExpiredJobs($queue . ':reserved', $queue);
    }
725954
public function pop($queue = null)
    {
        $original = $queue ?: $this->default;

        $queue = $this->getQueue($queue);

        if ( ! is_null($this->expire)) {
            $this->migrateAllExpiredJobs($queue);
        }

        $job = $this->getConnection()->lpop($queue);

        if ( ! is_null($job)) {
            $this->getConnection()->zadd($queue.':reserved', $this->getTime() + $this->expire, $job);

            return new RedisJob($this->container, $this, $job, $original);
        }
    }