Question about Joiner being an @FunctionalInterface

Alan Bateman alan.bateman at oracle.com
Sat Aug 30 14:49:29 UTC 2025


On 29/08/2025 15:24, David Alayachew wrote:
> Hello @loom-dev <mailto:loom-dev at openjdk.org>,
>
> I noticed just recently that StructuredTaskScope.Joiner is 
> an @FunctionalInterface. Is that merely a derived trait automatically 
> applied by the Javadoc/JDK? Or are there ways to make useful Joiners 
> using just the unimplemented result()? Only thing I could think of is 
> that it's useful for creating mock Joiners in unit tests, that just 
> return some pre-defined value. But even that is limited in its utility.
>
Thanks for bringing it up. It's a left over from an early iteration. We 
are going to propose some very minor changes for the next update and 
this includes dropping @FI. But yes, it might have some uses now with a 
test Joiner that returns a constant or something fixed but it's not very 
practical without implementing onFork or onComplete.

-Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20250830/7776967b/attachment-0001.htm>


More information about the loom-dev mailing list