Schedule a set of Task() instances.
965410
def Schedule(self, tasks, mutation_pool, timestamp=None):
    """"""
    non_fleetspeak_tasks = []
    for queue, queued_tasks in iteritems(
        collection.Group(tasks, lambda x: x.queue)):
      if not queue:
        continue

      client_id = _GetClientIdFromQueue(queue)
      if fleetspeak_utils.IsFleetspeakEnabledClient(
          client_id, token=self.token):
        for task in queued_tasks:
          fleetspeak_utils.SendGrrMessageThroughFleetspeak(client_id, task)
        continue
      non_fleetspeak_tasks.extend(queued_tasks)

    timestamp = timestamp or self.frozen_timestamp
    mutation_pool.QueueScheduleTasks(non_fleetspeak_tasks, timestamp)
976564
def _invoke_callbacks(self):
        """"""
        self.task_end_time = time.time()
        self.task_cost_time = self.task_end_time - self.task_start_time
        with self._condition:
            for callback in self._done_callbacks:
                try:
                    result = callback(self)
                    if callback in self._user_callbacks:
                        self._callback_result = result
                except Exception as e:
                    Config.main_logger.error("exception calling callback for %s" % e)
            self._condition.notify_all()
461852
def run(self):
        """"""
        tokens = []
        section = nodes.section()
        section['ids'].append("available-tasks")

        title = nodes.title()
        title += nodes.Text("Default tasks")
        section += title

        task_finder = TaskFinder(Collector())
        for name, task in sorted(task_finder.default_tasks().items(), key=lambda x: len(x[0])):

            lines = [name] + ["  {0}".format(line.strip()) for line in task.description.split('\n')]
            viewlist = ViewList()
            for line in lines:
                viewlist.append(line, name)
            self.state.nested_parse(viewlist, self.content_offset, section)

        return [section]
532781
public void schedule(Runnable r, long delay, TimeUnit unit) {
        pool.get().schedule(r, delay, unit);
    }
71854
def job(name, **kwargs):
    ''''''
    return task(name=name, schedulable=True, base=JobTask,
                bind=True, **kwargs)
455690
def _gen_tasks(self):
        """"""
        for filename in self.args:
            path = os.path.abspath(filename)
            yield {
                'name': path,
                # 'file_dep': [path],
                'actions': [(self.fun, (filename,))],
            }
114516
def set_schedule(self, schedule):
        
        self.Tmax = schedule['tmax']
        self.Tmin = schedule['tmin']
        self.steps = int(schedule['steps'])
        self.updates = int(schedule['updates'])
1076284
def schedule(self, function, args=(), kwargs={}):
        
        self._check_pool_state()

        future = Future()
        payload = TaskPayload(function, args, kwargs)
        task = Task(next(self._task_counter), future, None, payload)

        self._context.task_queue.put(task)

        return future
1180444
def _schedule_callbacks(self, clear_cb=False):
        """"""
        self.task_end_time = time.time()
        self.task_cost_time = self.task_end_time - self.task_start_time
        callbacks = self._callbacks[:]
        if not callbacks:
            return
        if clear_cb:
            self._callbacks[:] = []
        for callback in callbacks:
            self._loop.call_soon(callback, self, *self.extra_args)
343804
void scheduleHeronWorkers(Set<ContainerPlan> containers) throws ContainerAllocationException {
    for (ContainerPlan containerPlan : containers) {
      int id = containerPlan.getId();
      if (containerPlans.containsKey(containerPlan.getId())) {
        throw new ContainerAllocationException("Received duplicate allocation request for " + id);
      }
      Resource reqResource = containerPlan.getRequiredResource();
      containerPlans.put(id, containerPlan);
      requestContainerForWorker(id, new HeronWorker(id, reqResource));
    }
  }
929232
void scheduleDrainBuffers() {
    if (drainStatus() >= PROCESSING_TO_IDLE) {
      return;
    }
    if (evictionLock.tryLock()) {
      try {
        int drainStatus = drainStatus();
        if (drainStatus >= PROCESSING_TO_IDLE) {
          return;
        }
        lazySetDrainStatus(PROCESSING_TO_IDLE);
        executor().execute(drainBuffersTask);
      } catch (Throwable t) {
        logger.log(Level.WARNING, "Exception thrown when submitting maintenance task", t);
        maintenance(/* ignored */ null);
      } finally {
        evictionLock.unlock();
      }
    }
  }
1144742
def create_task(self, *command_tokens, **command_env):
		
		return self.__scheduled_task_cls(self.basic_command(), *command_tokens, **command_env)
214668
private void setTasks(String tasks) {
		for (String task : tasks.split(",")) {
			if (KNOWN_TASKS.containsKey(task)) {
				this.tasks |= KNOWN_TASKS.get(task);
				this.taskName += (this.taskName.isEmpty() ? "" : "-") + task;
			} else {
				logger.warn("Unsupported RDF serialization task \"" + task
						+ "\". Run without specifying any tasks for help.");
			}
		}
	}
1123603
def schedule_tasks(self):
        
        url = 'api/v6/releases/%d/schedule-tasks' % self.id
        tasks = yield self.connection._get(url)
        defer.returnValue(munchify(tasks))
1018064
def start_tasks(self):
        
        while self.tasks_at_once > len(self.pending_results) and self._has_more_tasks():
            task, parent_result = self.tasks.popleft()
            self.execute_task(task, parent_result)
1222491
def put_task(self, task):
        ''''''
        _schedule = task.get('schedule', self.default_schedule)
        self.projects[task['project']].task_queue.put(
            task['taskid'],
            priority=_schedule.get('priority', self.default_schedule['priority']),
            exetime=_schedule.get('exetime', self.default_schedule['exetime'])
        )
758998
boolean schedule(Runnable task,
                   ClassLoader loader,
                   long timeout)
  {
    return schedule(new RunnableItem(task, loader, timeout));
  }