Add JobId to queue
@param        $jobId
@param string $queueName
@param array  $otherData
@return int $messageId
191566
protected function enqueue($jobId, $queueName = 'default', $otherData = [])
    {
        /** @var QueueService $queue */
        $queue = $this->container->get('syrup.queue_factory')->get($queueName);
        return $queue->enqueue($jobId, $otherData);
    }
624287
public function getJob($jobId)
    {
        $url = parse_url($this->getBaseUrl());
        return $this->get("https://{$url['host']}/queue/job/{$jobId}")->send()->json();
    }
48961
public function push($class, $args = [], $retry = true, $queue = self::QUEUE)
    {
        $jobId = $this->idGenerator->generate();
        $this->atomicPush($jobId, $class, $args, $queue, $retry);

        return $jobId;
    }
1144223
public function updateJob($jobId, UpdateJobParameters $parameters)
    {
        $requestData = $this->getDefaultRequestData('json', $parameters->exportToArray());
        return $this->sendRequest('jobs/' . $jobId, $requestData, self::HTTP_METHOD_PUT);
    }
461927
private void addInternalJobListener(JobListener jobListener) {

    if (jobListener.getName() == null || jobListener.getName().length() == 0) {
      throw new IllegalArgumentException("JobListener name cannot be empty.");
    }

    synchronized (internalJobListeners) {
      internalJobListeners.put(jobListener.getName(), jobListener);
    }
  }
1333551
public function runNextJob($workCommand, $connectionName, $queue, WorkerOptions $options)
    {
        $job = $this->getNextJob(
            $this->manager->connection($connectionName), $queue
        );

        // If we're able to pull a job off of the stack, we will process it and then return
        // from this method. If there is no job on the queue, we will "sleep" the worker
        // for the specified number of seconds, then keep processing jobs after sleep.
        if ($job) {
            return $this->runJob($workCommand, $job, $connectionName, $options);
        }

        $this->sleep($options->sleep);
    }
306967
public function addJob($id, $job)
    {
        if (is_array($job)) {
            $job = Job::fromArray($job);
        }
        $this->incomingJobs[$id] = $job;
    }
1073252
public function runDelayed($jobId, \Closure $runCallback)
    {
        $job = $this->jobProcessor->findJobById($jobId);
        if (! $job) {
            throw JobNotFoundException::create($jobId);
        }
        $this->throwIfJobIsStale($job);

        if ($job->getRootJob()->isInterrupted()) {
            if (! $job->getStoppedAt()) {
                $this->jobProcessor->cancelChildJob($job);
            }

            return null;
        }

        $this->jobExtension->onPreRunDelayed($job);

        if ($this->isReadyForStart($job)) {
            $this->jobProcessor->startChildJob($job);
        }

        $result = $this->callbackResult($runCallback, $job);

        if (! $job->getStoppedAt()) {
            $result
                ? $this->jobProcessor->successChildJob($job)
                : $this->jobProcessor->failChildJob($job);
        }

        $this->jobExtension->onPostRunDelayed($job, $result);

        return $result;
    }
404349
private function atomicPush($jobId, $class, $args = [], $queue = self::QUEUE, $retry = true, $doAt = null)
    {
        if (array_values($args) !== $args) {
            throw new Exception('Associative arrays in job args are not allowed');
        }

        if (!is_null($doAt) && !is_float($doAt) && is_string($doAt)) {
            throw new Exception('at argument needs to be in a unix epoch format. Use microtime(true).');
        }

        $job = $this->serializer->serialize($jobId, $class, $args, $retry, $queue);

        if ($doAt === null) {
            $this->redis->sadd($this->name('queues'), $queue);
            $this->redis->lpush($this->name('queue', $queue), $job);
        } else {
            $this->redis->zadd($this->name('schedule'), $doAt, $job);
        }
    }
79114
public function getMessageByJob($job, array $data = [])
    {
        $message = new QueueMessage();

        $job = $this->createJobInstance($job);

        $data['class'] = get_class($job);

        $message->setName($job->getName());
        $message->setJob(serialize($job));
        $message->setData($data);

        return $message;
    }
820714
public function push($job, $data = '', $queue = null)
    {
        $queueJob = $this->resolveJob($this->createPayload($job, $data, $queue), $queue);

        $queueJob->handle();

        return 0;
    }
135307
public void mergeCalls(String connId, String otherConnId) throws WorkspaceApiException {
        this.mergeCalls(connId, otherConnId, null, null);
    }
751851
public static void addJob(String jobName, String jobClassName) throws SundialSchedulerException {

    addJob(jobName, jobClassName, null, false);
  }
540414
public function peek($jobId)
	{
		$response = $this->_dispatch(
			new Pheanstalk_Command_PeekCommand($jobId)
		);

		return new Pheanstalk_Job($response['id'], $response['jobdata']);
	}
90553
public function createJob($storeName, $reindex, $background, $queueName = null)
    {
        $configInstance = $this->getConfigInstance();
        if (!$queueName) {
            $queueName = $configInstance::getEnsureIndexesQueueName();
        } elseif (strpos($queueName, $configInstance::getEnsureIndexesQueueName()) === false) {
            $queueName = $configInstance::getEnsureIndexesQueueName() . '::' . $queueName;
        }

        $data = [
            self::STORENAME_KEY => $storeName,
            self::REINDEX_KEY => $reindex,
            self::BACKGROUND_KEY => $background
        ];

        $this->submitJob($queueName, get_class($this), array_merge($data, $this->generateConfigJobArgs()));
    }
352760
public void addInternalJobListener (final IJobListener jobListener)
  {
    ValueEnforcer.notNull (jobListener, "JobListener");
    ValueEnforcer.notEmpty (jobListener.getName (), "JobListener.getName()");

    synchronized (m_aInternalJobListeners)
    {
      m_aInternalJobListeners.put (jobListener.getName (), jobListener);
    }
  }
356030
public function addRequest($messageBody, $server, $requestId, $routingKey = '')
    {
        if (empty($requestId)) {
            throw new \InvalidArgumentException("You must provide a request ID");
        }
        $this->setParameter('correlation_id', $requestId);
        $this->setParameter('reply_to', $this->queueName);

        $message = new AMQPMessage(
            $messageBody,
            $this->getParameters()
        );

        $this->channel
            ->basic_publish($message, $server . '-exchange', $routingKey);

        $this->requests++;
    }