code: def work_once(self, free_pool_slots=1, max_jobs=None):
          
  
          dequeued_jobs = 0
  
          available_queues = [
              queue for queue in self.queues
              if queue.root_id not in self.paused_queues and
              queue.id not in self.paused_queues
          ]
  
          for queue_i in range(len(available_queues)):
  
              queue = available_queues[(queue_i + self.queue_offset) % len(available_queues)]
  
              max_jobs_per_queue = free_pool_slots - dequeued_jobs
  
              if max_jobs_per_queue <= 0:
                  queue_i -= 1
                  break
  
              if self.config["dequeue_strategy"] == "parallel":
                  max_jobs_per_queue = max(1, int(max_jobs_per_queue / (len(available_queues) - queue_i)))
  
              for job in queue.dequeue_jobs(
                  max_jobs=max_jobs_per_queue,
                  job_class=self.job_class,
                  worker=self
              ):
                  dequeued_jobs += 1
  
                  self.gevent_pool.spawn(self.perform_job, job)
  
          # At the next pass, start at the next queue to avoid always dequeuing the same one
          if self.config["dequeue_strategy"] == "parallel":
              self.queue_offset = (self.queue_offset + queue_i + 1) % len(self.queues)
  
          # TODO consider this when dequeuing jobs to have strict limits
          if max_jobs and self.done_jobs >= max_jobs:
              self.log.info("Reached max_jobs=%s" % self.done_jobs)
              return "break", dequeued_jobs
  
          # We seem to have exhausted available jobs, we can sleep for a
          # while.
          if dequeued_jobs == 0:
  
              if self.config["dequeue_strategy"] == "burst":
                  self.log.info("Burst mode: stopping now because queues were empty")
                  return "break", dequeued_jobs
  
              return "wait", dequeued_jobs
  
          return None, dequeued_jobs
docs: Does one lookup for new jobs, inside the inner work loop