groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Balachandran Sivakumar <benignb...@gmail.com>
Subject Re: GPars 2 Stuff
Date Mon, 08 Jan 2018 02:51:51 GMT
Hi Dr. Russel,

On Thu, Jan 4, 2018 at 12:20 AM, Russel Winder <russel@winder.org.uk> wrote:
> In GPars 1.X it was possible to do things such as:
>
>     [1, 2, 3, 4, 5].parallel.reduce{a, b -> Math.min(a, b)}
>
> Without GPars it is possible using Groovy to achieve the exact same
> functionality on JDK8+ with:
>
>     [1, 2, 3, 4, 5].parallelStream().reduce{a, b -> Math.min(a, b)}.get()
>

    The GPars way is a lot more terse and more "functional" than the
JDK8+ way. As a user, we don't have to know whether the underlying
stuff is a parallelStream or ParallelArray(like it is in GPars 1.x).
So, I would prefer to retain the API, but base it over streams instead
of ParallelArrays. Thanks



-- 
Thank you
Balachandran Sivakumar

Mime
View raw message