Structured Concurrency yet again

Pedro Lamarão pedro.lamarao at prodist.com.br
Tue May 9 17:09:37 UTC 2023


Em ter., 9 de mai. de 2023 às 13:35, Remi Forax <forax at univ-mlv.fr>
escreveu:


> If we put everything together, we get the following code
>
>   try(var scope = new AsyncScope<Integer, RuntimeException>()) {
>       AsyncTask<Integer, RuntimeException> task = scope.async(() -> {
>           Thread.sleep(100);
>           return 10;
>       });
>       var task2 = scope.async(() -> {
>           Thread.sleep(300);
>           return 30;
>       });
>


How would we use AsyncScope to concurrently call two services which return
different data types?

-- 
Pedro Lamarão
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20230509/242a2f47/attachment.htm>


More information about the loom-dev mailing list