Add the job to the waiting list, at the end (it's a fifo list). If
        `prepend` is True, add it at the beginning of the list.
428512
def enqueue_job(self, job, prepend=False):
        
        push_method = getattr(self.waiting, 'lpush' if prepend else 'rpush')
        push_method(job.ident)
71277
def add_done_callback(self, callback):
        
        if self._done is None or self._done.is_set():
            raise ValueError('Task has already finished')
        if callable(callback):
            self.callbacks.append(callback)
1341018
def add_job(self, job_name, job_id=None):
        
        logger.debug('Creating a new job named {0}'.format(job_name))
        if not self._name_is_available(job_name):
            raise DagobahError('name %s is not available' % job_name)

        if not job_id:
            job_id = self.backend.get_new_job_id()
            self.created_jobs += 1

        self.jobs.append(Job(self,
                             self.backend,
                             job_id,
                             job_name))

        job = self.get_job(job_name)
        job.commit()
1294791
def add_event(self, event, prepend=False):
        
        if prepend:
            self._events.insert(0, event)
        else:
            self._events.append(event)
908353
def ready(worker)
      if @work_queue.empty?
        @workers.insert(0, worker) unless @workers.include?(worker)
      else
        job = @work_queue.pop()
        @add_thread.wakeup() unless @add_thread.nil?
        ask_worker(worker, job)
      end
    end
1185466
def put_task(self, dp, callback=None):
        
        f = Future()
        if callback is not None:
            f.add_done_callback(callback)
        self.input_queue.put((dp, f))
        return f
1189788
def maybe_put_task(self):
        """"""
        try:
            task = next(self.tasks)
        except StopIteration:
            pass
        else:
            log.debug('Putting %s on queue', task)
            self.task_queue.put(task)
1000708
protected function addToListBottom()
    {
        if ($this->isInList()) return;

        $newPosition = $this->getBottomPositionValue();

        if (null === $newPosition) {
            $newPosition = $this->listifyTop();
        } else {
            $newPosition += 1;
        }

        $this->setListifyPosition($newPosition);
    }
593771
public void add (Schedulable schedulable, int frequency, int phase, float priority) {
		// Compile the record and add it to the list
		schedulableRecords.add(new PrioritySchedulableRecord(schedulable, frequency, phase, priority));
	}
114680
def prepend_field(self, field_name, list_value):
    """"""
    return self._single_list_field_operation(field_name, list_value, prepend=True)
301297
def __append_list(append_to, value):
    """"""
    if value is not None:
        if isinstance(value, list):
            append_to.extend(value)
        else:
            append_to.append(value)
1261611
def append(self, item):
        
        with self.lock:
            with self._closeable_cursor() as cursor:
                cursor.execute('''INSERT INTO list (list_index, value) VALUES ((SELECT MAX(list_index) FROM list) + 1, ?)''', (self._coder(item), ) )
            self._do_write()
781791
public function prepend()
    {
        $script = $this->parseArgs(func_get_args());
        if ($script !== false && !in_array($script, $this->members)) array_unshift($this->members, $script);
    }
53522
def append(self, future):
        
        future.prev = self.tail
        if self.tail is None:
            assert self.head is None
            self.head = future
        else:
            self.tail.next = future
        self.tail = future
        # Once done, it will be removed from the list.
        future.add_done_callback(self.remove)
986651
def add_done_callback(self, fn):
        
        if self.done():
            return fn(self)
        self._callbacks.append(fn)
668115
function addFileToQueue(filename, callback){
  if (processingPaths[filename]) {
    if (typeof callback == 'function')
      processingPaths[filename].unshift(callback);

    return;
  }

  processingPaths[filename] = typeof callback == 'function'
    ? [callback].concat(readCallbacks)
    : readCallbacks.slice();

  if (readingCount < READ_LIMIT)
    readFile(filename);
  else
  {
    logMsg('fs', relativePath(filename) + ' ' + chalk.yellow('(add file to queue)'), true);
    filesToRead.push(filename);
  }
}
185876
def enqueue_jobs(self, jobs: Iterable[Job]):
        """"""
        for job in jobs:
            if job.should_start:
                job.status = JobStatus.QUEUED
                queue = self._get_queue(job.queue)
                queue.put(job.serialize())
            else:
                with self._lock:
                    job.status = JobStatus.WAITING
                    self._future_jobs.append(job.serialize())
                    self._future_jobs.sort(key=lambda j: Job.deserialize(j).at)
        self._something_happened.set()