Structured concurrency with runnables?
Eric Kolotyluk
eric at kolotyluk.net
Thu May 11 16:32:01 UTC 2023
Yes, that works, but it would be nice to skip the boilerplate and and
just do
scope.fork( new Runnable(...));
On 2023-05-11 9:15 a.m., Remi Forax wrote:
>
>
> ------------------------------------------------------------------------
>
> *From: *"Josiah Noel" <josiahnoel at gmail.com>
> *To: *"loom-dev" <loom-dev at openjdk.org>
> *Sent: *Thursday, May 11, 2023 5:53:11 PM
> *Subject: *Structured concurrency with runnables?
>
> Would be nice if there was a variant of fork could take a
> Runnable. Turning my runnable tasks into Callable is relatively
> easy, but it's an inconvenience nonetheless.
>
>
> Callable<Void> callable = Executors.callable(runnable, null);
>
> regards,
> Rémi
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20230511/943ad49f/attachment-0001.htm>
More information about the loom-dev
mailing list