Timeouts in structured concurrency
David Alayachew
davidalayachew at gmail.com
Fri Dec 19 08:14:27 UTC 2025
I don't understand your response to my quote @Alan Bateman
<Alan.Bateman at oracle.com>.
> We held back from adding a 1-arg open method that takes a configuration
> function as it doubles down on the defaults.
I don't understand -- are you saying that doubling down on the defaults is
a bad thing, and that's why you held back? Why would doubling down on the
defaults be bad?
Or are you saying that you held back IN ORDER TO double down on the
defaults? In which case, I understand what you mean by that even less.
> We are confident that the "all of nothing" case is the most important
> case, and this means the scope will be cancelled if any subtask fails.
> It is harder to get a sense as to whether subtasks produce results of
> the same type or different types, that is what determines if the default
> is allSuccessfulOrThrow [1] or awaitAllSuccessfulOrThrow [2].
The first sentence here makes sense (I even agree with you), but I don't
see how it relates to the second sentence. Or how the second sentence is
relevant to any part of my response.
Did you maybe mean to respond to someone else besides me?
On Fri, Dec 19, 2025 at 1:49 AM Alan Bateman <alan.bateman at oracle.com>
wrote:
>
>
> On 18/12/2025 21:00, David Alayachew wrote:
> > :
> >
> > That said, if you dislike a 0 parameter call being forced into being a
> > 2 paramefer call when you need to add timeout, then sure, I think
> > adding an overload for that static method that takes in the
> > configFunction is reasonable. I'd support that.
> >
> The no-arg open method is the only method uses the default configuration
> and the "default" policy/joiner. We held back from adding a 1-arg open
> method that takes a configuration function as it doubles down on the
> defaults. We are confident that the "all of nothing" case is the most
> important case, and this means the scope will be cancelled if any
> subtask fails. It is harder to get a sense as to whether subtasks
> produce results of the same type or different types, that is what
> determines if the default is allSuccessfulOrThrow [1] or
> awaitAllSuccessfulOrThrow [2].
>
> -Alan
>
> [1]
>
> https://download.java.net/java/early_access/jdk26/docs/api/java.base/java/util/concurrent/StructuredTaskScope.Joiner.html#allSuccessfulOrThrow()
> [2]
>
> https://download.java.net/java/early_access/jdk26/docs/api/java.base/java/util/concurrent/StructuredTaskScope.Joiner.html#awaitAllSuccessfulOrThrow()
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20251219/4fdcf242/attachment.htm>
More information about the loom-dev
mailing list