Simplifying sequential() / parallel()

Tim Peierls tim at peierls.net
Fri Mar 22 08:48:58 PDT 2013


On Thu, Mar 21, 2013 at 3:47 PM, Brian Goetz <brian.goetz at oracle.com> wrote:

> Before we go there, does anyone have use cases for .sequential() /
> .parallel() that *don't* put the parallel right after the source, or the
> sequential right before a forEach?
>

[Assuming stateful mappers are banned:]

Even if someone *does* come up with such a use case, e.g., (using current
semantics)

    s.parallel().x().sequential().y().terminal()

isn't it always possible to fake this with a custom collector that combines
y() and terminal()? (Or other mildly painful tricks.)

--tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/lambda-libs-spec-experts/attachments/20130322/a463ace2/attachment.html 


More information about the lambda-libs-spec-experts mailing list