StructuredTaskScope API open can use an UnaryOperator instead of a Function
Alan Bateman
alan.bateman at oracle.com
Tue May 20 07:03:09 UTC 2025
On 20/05/2025 07:53, Remi Forax wrote:
> Hello,
> i've just taken a look to the new StructuredTaskScope API,
> i've seen a small improvement that can be done to the API.
>
> There is a method open that takes a joiner and a configuration function (a configuration builder really)
>
> open(Joiner<? super T, ? extends R> joiner, Function<Configuration, Configuration> configFunction)
>
> In java.util.function, there is already a type for the function that return the same type as the parameter, it's UnaryOperator,
> so the signature of open(joiner, configFunction) can be simplified to
>
> open(Joiner<? super T, ? extends R> joiner, UnaryOperator<Configuration> configFunction)
>
Noted. Nicolai Parlog pointed this out recently too. It wouldn't change
the intended usage but would make the signature look less scary. So the
list to look at for the next update.
-Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20250520/a4433194/attachment.htm>
More information about the loom-dev
mailing list