Calling StructuredTaskScope.join() several times inside the same scope

Josiah Noel josiahnoel at gmail.com
Mon Sep 4 20:42:29 UTC 2023


 I've got an orchestration API that calls multiple downstream services and
dbs. So I've got multiple sets of async tasks that go in sequence, if any
should fail the whole process itself should fail. I use one SOF for all of
this so I don't have to make multiple try-catch statements for each set of
async tasks. I've personally not seen a use for SOS in my workflows as I
tend to deal with async tasks that return different types.

On Mon, Sep 4, 2023 at 2:58 PM Alan Bateman <Alan.Bateman at oracle.com> wrote:

>
>
> On 04/09/2023 15:45, Josiah Noel wrote:
> > Isn't it in the name that ShutdownOnSuccess would shutdown on success?
> > The way I use it, I don't expect anything different.
> >
> > On JDK 20, I used ShutdownOnFailure if I wanted to call join multiple
> > times. Also I have in fact done it a bunch, so I hope this hasn't been
> > removed?
> >
> I'm curious why you use it this way, does this usage mechanically
> convert to create a SOS per round of forking?
>
> -Alan
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20230904/565ad1e7/attachment-0001.htm>


More information about the loom-dev mailing list