Marks a set of tasks as dependents of this task, if they are not already
dependents. *A task can have at most 30 dependents.*

@param  task The task to add dependents to.
@return Request object
519688
public ItemRequest<Task> addDependents(String task) {
    
        String path = String.format("/tasks/%s/addDependents", task);
        return new ItemRequest<Task>(this, Task.class, path, "POST");
    }
509609
private synchronized void runTask(Task task) {
        if (taskThread == null) {
            taskThread = new TaskThread();
        }
        taskThread.runTask(task);
    }
1275107
public function setTask(Task $task = null)
    {
        $this->task = $task;
        if (null !== $task) {
            $task->addTransition($this);
        }

        return $this;
    }
1050174
def dependents(self, task, params={}, **options): 
        
        path = "/tasks/%s/dependents" % (task)
        return self.client.get(path, params, **options)
5183
@Override
	protected Task<E> copyTo (Task<E> task) {
		if (!lazy) throw new TaskCloneException("A non-lazy " + getClass().getSimpleName() + " should never be copied.");

		Include<E> include = (Include<E>)task;
		include.subtree = subtree;
		include.lazy = lazy;

		return task;
	}
356539
private void makeGenerators(Task task) {
        if (this.cookieGenerator != null) {
            if (!(this.cookieGenerator instanceof NoCookieGenerator)) {
                this.setCookie(this.cookieGenerator.get(task));
            }
        }
        if (this.headerGenerator != null) {
            if (!(this.headerGenerator instanceof NoHeaderGenerator)) {
                Map headers = this.headerGenerator.get(task);
                this.setHttpHeader(headers);
            }
        }
    }
145336
public void submit(Task<? extends TaskResult> task) {

        // Increment the counter which indicates the number of results to
        // expect. This must be done BEFORE actually submitting the task for
        // execution.
        remainingTasks.incrementAndGet();

        // Increment the statistics and put the task on the correct queue.
        stats.incrementStartedTasks(task.resultType);
        executors.get(task.resultType).submit(task);

        // Make sure that the task gets added to the results queue.
        resultsQueue.add(task);
        stats.updateMemoryInfo();
    }
997112
@Override
    public Task createTask(Task task) throws NameConflictException {
        try {
            return taskDao.createTask(task);
        } catch (DuplicateKeyException e) {
            throw new NameConflictException("Task name is already in use", e);
        }
    }
905556
public ItemRequest<Task> removeTag(String task) {
    
        String path = String.format("/tasks/%s/removeTag", task);
        return new ItemRequest<Task>(this, Task.class, path, "POST");
    }
963373
public boolean add(final Task task) throws EntryExistsException
  {
    if (taskStorage.getTask(task.getId()).isPresent()) {
      throw new EntryExistsException(StringUtils.format("Task %s is already exists", task.getId()));
    }

    giant.lock();

    try {
      Preconditions.checkState(active, "Queue is not active!");
      Preconditions.checkNotNull(task, "task");
      Preconditions.checkState(tasks.size() < config.getMaxSize(), "Too many tasks (max = %,d)", config.getMaxSize());

      // If this throws with any sort of exception, including TaskExistsException, we don't want to
      // insert the task into our queue. So don't catch it.
      taskStorage.insert(task, TaskStatus.running(task.getId()));
      addTaskInternal(task);
      managementMayBeNecessary.signalAll();
      return true;
    }
    finally {
      giant.unlock();
    }
  }
670954
protected int incrementDependentWriteCount() {
        dependentWriteCount++;
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "incrementDependentWriteCount entry: new dependentWriteCount of: " + dependentWriteCount + " for node: " + this);
        }
        return dependentWriteCount;
    }
722922
private Task taskToBeRescheduled(Task task) {
        Task taskToBeRetried = task.copy();
        taskToBeRetried.setTaskId(IDGenerator.generate());
        taskToBeRetried.setRetriedTaskId(task.getTaskId());
        taskToBeRetried.setStatus(SCHEDULED);
        taskToBeRetried.setRetryCount(task.getRetryCount() + 1);
        taskToBeRetried.setRetried(false);
        taskToBeRetried.setPollCount(0);
        taskToBeRetried.setCallbackAfterSeconds(0);
        task.setRetried(true);
        return taskToBeRetried;
    }
1123649
private void init(final Task<Revision> task)
	{
		this.partCounter++;
		this.result = new Task<Diff>(task.getHeader(), partCounter);
	}
8797
public void runTask(Handler<Task> task) {
    if (currentTask == null) {
      currentTask = new Task(this);
      task.handle(currentTask);
    } else {
      queue.add(task);
    }
  }
297002
void addQueueTask(final DownloadTaskAdapter task) {
        if (task.isMarkedAdded2List()) {
            Util.w(TAG, "queue task: " + task + " has been marked");
            return;
        }

        synchronized (list) {
            task.markAdded2List();
            task.assembleDownloadTask();
            list.add(task);
            Util.d(TAG, "add list in all " + task + " " + list.size());
        }
    }
720526
@Override
    public void put(Set<Task> tasks) {
        String msgBody = null;
        SendMessageBatchRequestEntry msgEntry = null;
        Set<SendMessageBatchRequestEntry> msgEntries = new HashSet<>();
        for (Task task : tasks) {
            msgBody = unmarshallTask(task);
            msgEntry = new SendMessageBatchRequestEntry()
                .withMessageBody(msgBody)
                .withId(msgEntries.size() + "");  // must set unique ID for each msg in the batch request
            msgEntries.add(msgEntry);

            // Can only send batch of max 10 messages in a SQS queue request
            if (msgEntries.size() == 10) {
                this.sendBatchMessages(msgEntries);
                msgEntries.clear();  // clear the already sent messages
            }
        }

        // After for loop check to see if there are msgs in msgEntries that
        // haven't been sent yet because the size never reached 10.
        if (!msgEntries.isEmpty()) {
            this.sendBatchMessages(msgEntries);
        }
    }
1138946
public CollectionRequest<Attachment> findByTask(String task) {
    
        String path = String.format("/tasks/%s/attachments", task);
        return new CollectionRequest<Attachment>(this, Attachment.class, path, "GET");
    }