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

Add Tasks.<T>seq(Iterable<? extends Task<?>>, Task<T> resultTask) method #23

Closed
yborovikov opened this issue Jan 21, 2013 · 2 comments
Closed

Comments

@yborovikov
Copy link
Contributor

Sometimes client needs to run a sequence of tasks, and then one final task that returns the result:

{
  Iterable<Task<Foo>> fooTasks = buildFooTasks(...); // may return empty collection
  Task<Bar> barTask = new BarTask();
  Task<Bar> foosThenBarSeq = Tasks.seq(Tasks.seq(fooTasks), barTask); // will fail if fooTasks is empty
  Task<Bar> foosThenBarSeq = Tasks.seq(fooTasks, barTask); // looks cleaner and less if..then..else blocks
  ...
}
@cpettitt
Copy link
Contributor

Your proposal sounds good to me. I can take this as a pull request, if you're so inclined.

@jodzga
Copy link

jodzga commented May 12, 2015

API in version 2.x has changed so this issue does not apply to current state of ParSeq.

@jodzga jodzga closed this as completed May 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants