<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Hi David,</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
First of all¡Xthank you for your feedback!</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
I'm curious to learn more about why you ended up in the situation you describe below, specifically about what use-cases led you into wishing for an augmentation to Joiner to facilitate composition.</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Are you able to share more details?</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-size: 12pt;" class="elementToProof"><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; color: rgb(0, 0, 0);">></span><span style="font-family: monospace; color: rgb(0, 0, 0);">Which, funnily
enough, led to a slightly different problem -- I found myself wanting an easier way to create Joiners. Since I was leaning on Joiners so much more heavily than I was for STS, I ended up creating many Joiners that do almost the same thing, with just minor variations.
And inheritance wasn't always the right answer, as I can't inherit from multiple classes. Plus, most of my joiners were stateful, but I only wanted the non-stateful parts of it. I could do composition, but it sort of felt weird to delegate to multiple other
Joiners.</span></div>
<div class="elementToProof" id="Signature">
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Cheers,<br>
¡Ô</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<b><br>
</b></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<b>Viktor Klang</b></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Software Architect, Java Platform Group<br>
Oracle</div>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> loom-dev <loom-dev-retn@openjdk.org> on behalf of David Alayachew <davidalayachew@gmail.com><br>
<b>Sent:</b> Friday, 15 August 2025 11:52<br>
<b>To:</b> loom-dev <loom-dev@openjdk.org><br>
<b>Subject:</b> My experience with Structured Concurrency</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div class="x_gmail_default" style="font-family:monospace">Hello <a class="x_gmail_plusreply" id="x_plusReplyChip-0" href="mailto:loom-dev@openjdk.org" tabindex="-1">@loom-dev</a>,</div>
<div class="x_gmail_default" style="font-family:monospace"><br>
</div>
<div class="x_gmail_default" style="font-family:monospace">I just wanted to share my experience with Structured Concurrency. I had actually been using it for a while now, but only recently got experience with the new Joiner. After trying it out, my previously
stated opinion has changed.</div>
<div class="x_gmail_default" style="font-family:monospace"><br>
</div>
<div class="x_gmail_default" style="font-family:monospace">Overall, Structured Concurrency has been a pleasure. I'll avoid repeating ALL my old thoughts and just highlight the KEY details.</div>
<div class="x_gmail_default" style="font-family:monospace"><br>
</div>
<div class="x_gmail_default" style="font-family:monospace">* Structured Concurrency is excellent for complex error-handling. Receiving exceptions via the subtask makes all the error-handling less painful.</div>
<div class="x_gmail_default" style="font-family:monospace">* Structured Concurrency makes nesting scopes a breeze, a task I historically found very painful to do.</div>
<div class="x_gmail_default" style="font-family:monospace">* Inheritance allows me to take an existing Scope (now Joiner), and modify only what I need to in order to modify it for my use case. Great for reusing old strategies in new ways.</div>
<div class="x_gmail_default" style="font-family:monospace"><br>
</div>
<div class="x_gmail_default" style="font-family:monospace">Now for the new stuff -- having Joiner be the point of extension definitely proved to be the right move imo. I didn't mention this in my original message, but while it was easy to get a scope set up
using inheritance, it wasn't always clear what invariants needed to be maintained. For example, the ensureOwnerAndJoined method. Was that something we needed to call when inheriting? On which methods? Just join()?</div>
<div class="x_gmail_default" style="font-family:monospace"><br>
</div>
<div class="x_gmail_default" style="font-family:monospace">The Joiner solution is comparatively simpler, which actually meant that I ended up creating way more Joiners, rather than only several STS'. Joiners invariants are obvious, and there is no ambiguity
on what is expected from the implementor.</div>
<div class="x_gmail_default" style="font-family:monospace"><br>
</div>
<div class="x_gmail_default" style="font-family:monospace">Which, funnily enough, led to a slightly different problem -- I found myself wanting an easier way to create Joiners. Since I was leaning on Joiners so much more heavily than I was for STS, I ended
up creating many Joiners that do almost the same thing, with just minor variations. And inheritance wasn't always the right answer, as I can't inherit from multiple classes. Plus, most of my joiners were stateful, but I only wanted the non-stateful parts of
it. I could do composition, but it sort of felt weird to delegate to multiple other Joiners.</div>
<div><br>
</div>
<div>
<div class="x_gmail_default" style="font-family:monospace">Part of me kept wondering how well a factory method, similar to the ones for Collectors and Gatherers, might fare for Joiners.</div>
<div class="x_gmail_default" style="font-family:monospace"><br>
</div>
<div class="x_gmail_default" style="font-family:monospace">Regardless, even if we don't get that factory method, this library has been a pleasure, and I can't wait to properly implement this once it goes live.</div>
<div class="x_gmail_default" style="font-family:monospace"><br>
</div>
<div class="x_gmail_default" style="font-family:monospace">Thank you for your time and consideration.</div>
<div class="x_gmail_default" style="font-family:monospace">David Alayachew</div>
<br>
</div>
</div>
</div>
</body>
</html>