Enqueue a task execution.  It will run in the background as soon
        as the coordinator clears it to do so.
518003
def enqueue_task(self, source, *args):
        
        yield from self.cell.coord.enqueue(self)
        route = Route(source, self.cell, self.spec, self.emit)
        self.cell.loop.create_task(self.coord_wrap(route, *args))
        # To guarantee that the event loop works fluidly, we manually yield
        # once. The coordinator enqueue coroutine is not required to yield so
        # this ensures we avoid various forms of event starvation regardless.
        yield
675575
def run(self):
        
        for task in self.get_next_tasks(None):
            self.executor.add_task(task, None)
        while not self.executor.is_done():
            done_task_and_result = self.executor.wait_for_tasks()
            for task, task_result in done_task_and_result:
                self._add_sub_tasks_to_executor(task, task_result)
571437
function executeQueuedTasks () {
      // Delay execution to allow for more tasks to queue up
      setTimeout(() => {
        // Check if already executing and if any tasks ready for execution
        if (!executing && (queue.test.length || queue.build.length)) {
          // Flag executing status
          executing = true;
          // Pop a task from the execution queue
          const task = (queue.test.length ? queue.test.splice(0, 1)[0] : queue.build.splice(0, 1)[0]);
          // Execute task
          gulp.series([task])(() => {
            // Flag executing status
            executing = false;
            // Execute next task from the queue
            executeQueuedTasks();
          });
        }
      }, 250);
      // If no tasks queued up, prompt watcher done
      if (!executing && !(queue.test.length || queue.build.length)) {
        console.log();
        console.log(`> WATCHER(S) DONE PROCESSING - WAITING FOR CHANGES ...`.green);
        console.log();
      }
    }
194275
def enqueue(self, pipeline):
        
        copied = Pipeline().append(pipeline)
        copied.group = self
        self._queue.put(copied)
117510
def run(self):
        ''''''
        # We left-append rather than emit (right-append) because some message
        # may have been already queued for execution before the director runs.
        global_event_queue.appendleft((INITIATE, self, (), {}))
        while global_event_queue:
            self.process_event(global_event_queue.popleft())
1358637
synchronized void execute(File root, Runnable task) {
    if (executors == null) {
      throw new RuntimeException("AsyncDiskService is already shutdown");
    }
    ThreadPoolExecutor executor = executors.get(root);
    if (executor == null) {
      throw new RuntimeException("Cannot find root " + root
          + " for execution of task " + task);
    } else {
      executor.execute(task);
    }
  }
509609
private synchronized void runTask(Task task) {
        if (taskThread == null) {
            taskThread = new TaskThread();
        }
        taskThread.runTask(task);
    }
1256194
public function execute()
    {
        $queue = P\queue();

        while ($this->handles || !$queue->isEmpty()) {
            // If there are no transfers, then sleep for the next delay
            if (!$this->active && $this->delays) {
                usleep($this->timeToNext());
            }
            $this->tick();
        }
    }
418699
async def run_task(self) -> None:
        ''''''

        while self.running:
            try:
                item = self.QUEUE.get_nowait()

                Log.debug('%s processing work item', self.name)
                await self.run(item)

                Log.debug('%s completed work item', self.name)
                self.QUEUE.task_done()

            except asyncio.QueueEmpty:
                if self.OPEN:
                    await self.sleep(0.05)

                else:
                    Log.debug('%s queue closed and empty, stopping', self.name)
                    return

            except CancelledError:
                Log.debug('%s cancelled, dropping work item')
                self.QUEUE.task_done()
                raise

            except Exception:
                Log.exception('%s failed work item', self.name)
                self.QUEUE.task_done()
1305204
def launch_background_job(self, job, on_error=None, on_success=None):
        
        if not self.main.mode_online:
            self.sortie_erreur_GUI(
                "Local mode activated. Can't run background task !")
            self.reset()
            return

        on_error = on_error or self.sortie_erreur_GUI
        on_success = on_success or self.sortie_standard_GUI

        def thread_end(r):
            on_success(r)
            self.update()

        def thread_error(r):
            on_error(r)
            self.reset()

        logging.info(
            f"Launching background task from interface {self.__class__.__name__} ...")
        th = threads.worker(job, thread_error, thread_end)
        self._add_thread(th)
703536
public void executeInIoThread(Runnable task, boolean alwaysAsync) {
        if (!alwaysAsync && isIoThread()) {
            task.run();
        } else {
            registerTask(task);
        }
    }
453042
private static Runnable nextTask() {
		synchronized (lock) {
			// Block until we have another object in the queue to execute.
			while (taskList.isEmpty()) {
				try {
					lock.wait();
				} catch (InterruptedException ie) {
				}
			}
			return (Runnable) taskList.removeLast();
		}
	}
775065
synchronized void restart()
    {
        TransactionTask task = m_backlog.getFirst();
        if (task.needCoordination() && m_scoreboardEnabled) {
            coordinatedTaskQueueOffer(task);
        } else {
            taskQueueOffer(task);
        }
    }
349495
private void runTasks() {
    // Execute any tasks that were queue during execution of the command.
    if (!tasks.isEmpty()) {
      for (Runnable task : tasks) {
        log.trace("Executing task {}", task);
        task.run();
      }
      tasks.clear();
    }
  }
1351016
def enqueue(self, future):
    

    future.enqueue()
    with self._lock:
      if self._shutdown:
        raise RuntimeError('ThreadPool has been shut down and can no '
          'longer accept futures.')
      self._queue.append(future)
      if len(self._running) == len(self._workers):
        self._new_worker()
      self._lock.notify_all()
79459
def process(self):
        
        assert self.queue is not None
        while True:
            event = self.queue.get()
            if self.pre_process_event(event):
                self.invoke_handlers(event)
            self.queue.task_done()
634305
public void execute()
    {
        Runnable task = new Runnable()
        {
            public void run()
            {
                final V result = performTask();
                SwingUtilities.invokeLater(new Runnable()
                {
                    public void run()
                    {
                        postProcessing(result);
                        latch.countDown();
                    }
                });
            }
        };
        new Thread(task, "SwingBackgroundTask-" + id).start();
    }