List queued jobs

Shows the label of the next <i>$limit</i> Jobs in a given queue.

@param string $queue The name of the queue
@param integer $limit Number of jobs to list (some queues only support a limit of 1)
@return void
@throws JobQueueException
420405
public function listCommand($queue, $limit = 1)
    {
        $jobs = $this->jobManager->peek($queue, $limit);
        $totalCount = $this->queueManager->getQueue($queue)->countReady();
        foreach ($jobs as $job) {
            $this->outputLine('<b>%s</b>', [$job->getLabel()]);
        }

        if ($totalCount > count($jobs)) {
            $this->outputLine('(%d omitted) ...', [$totalCount - count($jobs)]);
        }
        $this->outputLine('(<b>%d total</b>)', [$totalCount]);
    }
199422
protected function retrieveNextJob($queue)
    {
        if (! is_null($this->blockFor)) {
            return $this->blockingPop($queue);
        }

        return $this->getConnection()->eval(
            LuaScripts::pop(), 2, $queue, $queue.':reserved',
            $this->availableAt($this->retryAfter)
        );
    }
1296313
public function paginateResult(Driver $driver, $modelClass, $page, $limit)
    {
        if (100 < $limit) {
            $limit = 100;
        }

        $this->managerFactory->setModelClass($modelClass);

        return $this->managerFactory->getManager($driver)->paginate($page, $limit);
    }
546746
public function deleteReserved($queue, $job)
	{
		$this->redis->zrem($this->getQueue($queue).':reserved', $job);
	}
40339
public function getJobs($limit = null)
    {
        $qb = $this->em->createQueryBuilder();
        $qb->select('job')
                ->from($this->jobEntityName, 'job')
                ->where(sprintf("job.%s = :job_status_active", $this->jobStatusColumn))
                ->orderBy(sprintf('job.%s', $this->jobPriorityColumn), 'DESC')
                ->addOrderBy(sprintf('job.%s', $this->jobDateLastRunColumn), 'ASC')
                ->setParameter('job_status_active', JobInterface::STATUS_ACTIVE);

        if (null !== $limit) {
            $qb->setMaxResults($limit);
        }

        return $qb->getQuery()->getResult();
    }
1073547
protected function migrateAllExpiredJobs($queue)
    {
        $this->migrateExpiredJobs($queue . ':delayed', $queue);

        $this->migrateExpiredJobs($queue . ':reserved', $queue);
    }
353426
public int getMaxJobsPerUserToInitialize(String queue) {
    int maxJobsPerUser = rmConf.getInt(toFullPropertyName(queue,
        "maximum-initialized-jobs-per-user"), 
        defaultMaxJobsPerUsersToInitialize);
    if(maxJobsPerUser <= 0) {
      throw new IllegalArgumentException(
          "Invalid maximum jobs per user configuration " + maxJobsPerUser);
    }
    return maxJobsPerUser;
  }
955401
public function queueOn($queue)
    {
        return $this->mailer->queueOn($queue, $this->view, $this->data, $this->prepareCallback());
    }
651294
public function bulk($jobs, $data = '', $queue = null)
    {
        $queue = $this->getQueue($queue);

        $availableAt = $this->getAvailableAt(0);

        $records = array_map(function ($job) use ($queue, $data, $availableAt)
        {
            return $this->buildDatabaseRecord(
                $queue, $this->createPayload($job, $data), $availableAt
            );

        }, (array) $jobs);

        return $this->database->table($this->table)->insert($records);
    }
340115
public function deleteReserved($queue, $job)
    {
        $this->redis->zRem($this->getQueue($queue) . ':reserved', $job->getReservedJob());
    }
1105277
public function read($limit = 0)
    {
        $this->limit($limit);
        $query = $this->buildSelect();
        $this->run($query['query'], $query['param']);

        return $this->next();
    }
885578
public function setLimit($limit)
    {
        $this->limit = $limit > 0 ? $limit : 1;

        $this->setPage($this->page);
    }
216350
protected function setQueue(Queue $queue)
    {
        $this->queue = $queue;
        $this->queue->setProducer($this);

        return $this;
    }
75134
public function getQueue(string $queueName): QueueInterface
    {
        if (isset($this->queues[$queueName])) {
            return $this->queues[$queueName];
        }

        $queueSettings = $this->getQueueSettings($queueName);

        if (!isset($queueSettings['className'])) {
            throw new JobQueueException(sprintf('Option className for queue "%s" is not configured', $queueName), 1334147126);
        }

        $queueObjectName = $queueSettings['className'];
        if (!class_exists($queueObjectName)) {
            throw new JobQueueException(sprintf('Configured class "%s" for queue "%s" does not exist', $queueObjectName, $queueName), 1445611607);
        }


        if (isset($queueSettings['queueNamePrefix'])) {
            $queueNameWithPrefix = $queueSettings['queueNamePrefix'] . $queueName;
        } else {
            $queueNameWithPrefix = $queueName;
        }
        $options = isset($queueSettings['options']) ? $queueSettings['options'] : [];
        $queue = new $queueObjectName($queueNameWithPrefix, $options);
        $this->queues[$queueName] = $queue;

        return $queue;
    }
559010
public function subscribe($queue)
    {
        if ($this->currentEnvelope) {
            throw new \RuntimeException('Don\'t be greedy and process the message you already have!');
        }

        $this->queue = $this->manager->getQueue((string) $queue);
    }
37389
protected function queueDeclare($queue)
    {
        $this->channel->queue_declare($queue, false, true, false, false);
    }
562605
public function setQueue( $queue )
	{
		$this->queue = $queue;

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

		return $this;
	}