Queue a job in Rhumba
771382
def queue(self, queue, message, params={}, uids=[]):
        

        d = {
            'id': uuid.uuid1().get_hex(),
            'version': 1,
            'message': message,
            'params': params
        }

        ser = json.dumps(d)
        
        if uids:
            for uid in uids:
                path = '/dq/%s/%s' % (uid, queue)
                yield self._put_queue(path, ser)

        else:
            path = '/q/%s' % queue
            yield self._put_queue(path, ser)

        defer.returnValue(d['id'])
108216
def requeue(self):
        """"""
        job_requeue_interval = float(
            self.config.get('sharq', 'job_requeue_interval'))
        while True:
            self.sq.requeue()
            gevent.sleep(job_requeue_interval / 1000.00)
1039057
def poll_queue
      @job = reserve_job
      if @job.nil?
        @log.info('No job found')
      else
        @log.info('Job starting')
        begin
          @current_job_start_time = Time.now
          execute_job
        rescue => e
          @log.info("Error running test: #{e.message}\n : #{e.backtrace.join("\n :")}")
        end
        cleanup
      end
    end
72446
def dequeue
      _, line = RRRSpec.redis.blpop(PERSISTER_QUEUE_KEY, 0)
      Taskset.new(line)
    end
82921
def enqueue_task(task)
      RRRSpec.redis.rpush(RRRSpec.make_key(key, 'task_queue'), task.key)
    end
884927
function EventHandlerQueue (status, job){
        console.log ("#%d- Queue Status=%s DevId=%s Command=%s JobReq=%d Retry=%d", count, status, job.devId, job.command, job.request, job.retry);
    }
1364535
def running(self, offset=0, count=25):
        ''''''
        return self.client('jobs', 'running', self.name, offset, count)
26105
def reserve(cls, queues, res, worker=None, timeout=10):
        
        if isinstance(queues, string_types):
            queues = [queues]
        queue, payload = res.pop(queues, timeout=timeout)
        if payload:
            return cls(queue, payload, res, worker)
118758
def run_job(key, node):
    """"""
    try:
        result = node.apply()
        return ResultMessage(key, 'done', result, None)

    except Exception as exc:
        return ResultMessage(key, 'error', None, exc)
748043
function queue(runner) {
    if (running < tasks) {
      ++running;
      runner(release);
    } else {
      pending.push(runner);
    }
  }
1118499
def requeue_job(self, job, queue, priority, delayed_for=None):
        
        job.requeue(queue_name=queue._cached_name,
                    priority=priority,
                    delayed_for=delayed_for,
                    queue_model=self.queue_model)

        if hasattr(job, 'on_requeued'):
            job.on_requeued(queue)

        self.log(self.job_requeue_message(job, queue))
1216080
def enqueue_taskset(taskset)
      RRRSpec.redis.rpush(RRRSpec.make_key(key, 'worker_queue'), taskset.key)
    end
1001807
async def handle_client_get_queue(self, client_addr, _: ClientGetQueue):
        
        #jobs_running: a list of tuples in the form
        #(job_id, is_current_client_job, agent_name, info, launcher, started_at, max_end)
        jobs_running = list()

        for backend_job_id, content in self._job_running.items():
            jobs_running.append((content[1].job_id, backend_job_id[0] == client_addr, self._registered_agents[content[0]],
                                 content[1].course_id+"/"+content[1].task_id,
                                 content[1].launcher, int(content[2]), int(content[2])+content[1].time_limit))

        #jobs_waiting: a list of tuples in the form
        #(job_id, is_current_client_job, info, launcher, max_time)
        jobs_waiting = list()

        for job_client_addr, msg in self._waiting_jobs.items():
            if isinstance(msg, ClientNewJob):
                jobs_waiting.append((msg.job_id, job_client_addr[0] == client_addr, msg.course_id+"/"+msg.task_id, msg.launcher,
                                     msg.time_limit))

        await ZMQUtils.send_with_addr(self._client_socket, client_addr, BackendGetQueue(jobs_running, jobs_waiting))
714645
def run_job(self, job_id, array_id = None):
    """"""
    # get the unique job id from the given grid id
    self.lock()
    jobs = list(self.session.query(Job).filter(Job.id == job_id))
    if len(jobs) != 1:
      self.unlock()
      raise ValueError("Could not find job id '%d' in the database'" % job_id)
    job_id = jobs[0].unique
    self.unlock()
    # call base class implementation with the corrected job id
    return JobManager.run_job(self, job_id, array_id)
585912
def process(job = nil, &block)
      return unless job ||= reserve

      job.worker = self
      working_on job
      perform(job, &block)
    ensure
      done_working
    end
859454
def requeue(rq, ctx, all, job_ids):
    ""
    return ctx.invoke(
        rq_cli.requeue,
        all=all,
        job_ids=job_ids,
        **shared_options(rq)
    )
733899
def enqueue(taskset, recalculate = false)
      RRRSpec.redis.rpush(STATISTICS_UPDATER_QUEUE_KEY,
        {taskset: taskset.key, recalculate: recalculate}.to_json)
    end