Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Javadoc for Task.par(Iterable<...>) should document on the result order. #241

Open
mchen07 opened this issue Jan 22, 2020 · 1 comment
Open

Comments

@mchen07
Copy link
Contributor

mchen07 commented Jan 22, 2020

No description provided.

@junchuanwang
Copy link
Contributor

Hi @mchen07 Min, I am not sure if I have enough context.

  /**
   * Creates a new task that will run each of the supplied tasks in parallel (e.g.
   * tasks[0] can be run at the same time as tasks[1]).
   * <p>
   * When all tasks complete successfully, you can use
   * {@link com.linkedin.parseq.ParTask#get()} to get a list of the results. If
   * at least one task failed, then this task will also be marked as failed. Use
   * {@link com.linkedin.parseq.ParTask#getTasks()} or
   * {@link com.linkedin.parseq.ParTask#getSuccessful()} to get results in this
   * case.
   * <p>
   * If the Iterable of tasks is empty, {@link com.linkedin.parseq.ParTask#get()}
   * will return an empty list.
   * <p>
   * Note that resulting task does not fast-fail e.g. if one of the tasks fail others
   * are not cancelled. This is different behavior than {@link Task#par(Task, Task)} where
   * resulting task fast-fails.
   *
   * @param tasks the tasks to run in parallel
   * @return The results of the tasks
   */
  public static <T> ParTask<T> par(final Iterable<? extends Task<? extends T>> tasks) {
    return tasks.iterator().hasNext()
        ? new ParTaskImpl<T>("par", tasks)
        : new ParTaskImpl<T>("par");
  }
When all tasks complete successfully, you can use
   * {@link com.linkedin.parseq.ParTask#get()} to get a list of the results.

Seems pretty clear to me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants