Push a job to the end of a specific queue. If the queue does not
exist, then create it as well.

@param string $queue The name of the queue to add the job to.
@param array $item Job description as an array to be JSON encoded.
438420
public static function push($queue, $item)
    {
        self::redis()->sadd('queues', $queue);
        self::redis()->rpush('queue:' . $queue, json_encode($item));
    }
1302268
public function add($item)
    {
        if ($item instanceof ItemInterface) {
            $this->items[] = $item;
        } else {
            $this->items[] = new MulticardsItem($item);
        }
    }
820714
public function push($job, $data = '', $queue = null)
    {
        $queueJob = $this->resolveJob($this->createPayload($job, $data, $queue), $queue);

        $queueJob->handle();

        return 0;
    }
852491
public function workingOn($job, $queue = null)
    {
        $job->worker = $this;
        $this->currentJob = $job;
        $this->working = true;
        if(isset($job->status)) {
            $job->status->update(ResqueJobStatus::STATUS_RUNNING);
        }
        $data = json_encode([
            'queue' => isset($queue) ? $queue : $job->queue,
            'run_at' => strtotime('now UTC'),
            'payload' => $job->payload
        ]);
        $this->resqueInstance->redis->set($this->workerName() . ':' . $job->worker, $data);
    }
608264
private function immediateNotification(&$group, &$item)
    {
        $item->complete();

        $immediateNotification = false;

        if (is_object($group) === true) {
            if (intval($group->group_notifications) === 0) {
                $immediateNotification = true;
            }
        } else {
            $immediateNotification = true;
        }
        if ($immediateNotification === true) {
            $this->trigger(
                self::EVENT_DEFERRED_QUEUE_COMPLETE,
                new DeferredQueueCompleteEvent($item)
            );
        }
    }
296020
public function writeItem($item)
    {
        if ($this->autoDetectHeader && !$this->header) {
            $this->handleAutoDetectHeader($item);
        }

        $this->table->addRow(
            $this->getValues($item, $this->getKeys($item))
        );
    }
844424
protected function createPayload($job, $data = '', $queue = null)
    {
        if (is_object($job)) {
            $payload = json_encode([
                'job' => 'Globalis\PuppetSkilled\Queue\CallQueuedHandler@call',
                'data' => [
                    'commandName' => get_class($job),
                    'command' => serialize(clone $job),
                ],
            ]);
        } else {
            $payload = json_encode($this->createPlainPayload($job, $data));
        }

        if (JSON_ERROR_NONE !== json_last_error()) {
            throw new InvalidArgumentException('Unable to create payload: '.json_last_error_msg());
        }

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

		try
		{
			$queueJob->fire();
		}
		catch(Exception $e)
		{
			$this->handleFailedJob($queueJob);

			throw $e;
		}

		return 0;
	}
627654
public function push($job, $data = null, $queue = null, $options = [])
    {
        return $this->pushInternal($this->createPayload($job, $data), $queue, $options);
    }
429412
def push(self, item, priority=None):
        
        priority = item if priority is None else priority
        node = PriorityQueueNode(item, priority)
        for index, current in enumerate(self.priority_queue_list):
            if current.priority < node.priority:
                self.priority_queue_list.insert(index, node)
                return
        # when traversed complete queue
        self.priority_queue_list.append(node)
112836
public function setQueue($queue, $value)
    {
        // Ensure the value is an array
        if (is_array($value) === false) {
            $value = [$value];
        }

        $this->queues[$queue] = array_merge(
            $this->getQueue($queue), $value
        );
    }
1280900
public function dequeue(&$item) : Queue
    {
        $values = $this->_shift($item);
        $this->setValues($values);
        return $this;
    }
583642
public function saveDeferred($key, $item, $ttl = null)
    {
        $this->queue[$key]['data'] = $item;
        if (null != $ttl) {
            $this->queue[$key]['ttl'] = $ttl;
        }
    }
1133747
protected function persist(Item $item)
    {
        $this->em->persist($item);
        foreach ($item->getNames() as $name) {
            $this->em->persist($name);
        }
        foreach ($item->getSources() as $source) {
            $this->em->persist($source);
        }
    }
35542
public function bulk($jobs, $data = '', $queue = null)
    {
        foreach ((array) $jobs as $job) {
            $this->push($job, $data, $queue);
        }
    }
675068
public function pushRaw($payload, $queue = null, array $options = [])
    {
        $this->jobs[] = [
            'type'    => 'push',
            'payload' => $payload,
            'queue'   => $queue,
            'options' => $options,
        ];
    }
364648
def move(self, queue_item, status):
        

        items = self.__get_var("items_" + queue_item.status)

        del items[queue_item.get_hash()]
        self.count_total -= 1

        queue_item.status = status
        self.add(queue_item)