<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Aptos;
        panose-1:2 11 0 4 2 2 2 2 2 4;}
@font-face
        {font-family:"Times New Roman \(Body CS\)";
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Menlo;
        panose-1:2 11 6 9 3 8 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Aptos",sans-serif;
        mso-ligatures:standardcontextual;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        font-size:11.0pt;
        font-family:"Aptos",sans-serif;
        mso-ligatures:standardcontextual;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Courier New";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:11.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:438986761;
        mso-list-type:hybrid;
        mso-list-template-ids:1567159222 -1988692318 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";
        mso-fareast-font-family:Aptos;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7 ;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7 ;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7 ;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7 ;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7 ;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style>
</head>
<body lang="EN-US" link="#467886" vlink="#96607D" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-family:"Courier New"">Things that felt strange or annoying:<o:p></o:p></span></p>
<ul style="margin-top:0in" type="disc">
<li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1"><span style="font-family:"Courier New"">When subclassing StructuredTaskScope I always have to @Override `join` and `joinUntil` to return my subclass type to provide a fluent api.<o:p></o:p></span></li><li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1"><span style="font-family:"Courier New"">When subclassing StructuredTaskScope @Override `handleComplete` I find myself wanting to write a switch expression on Subtask#state(), but if
 I do, I always need to have a case for UNAVAILABLE and throw IllegalStateException.<o:p></o:p></span></li><li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1"><span style="font-family:"Courier New"">Using StructuredTaskScope (no subclassing) feels weird because you must decide to use either the `<>` diamond operator to allow any types or
 define a type T for restricting subtasks (makes you wonder if you are using it correctly). Whereas, both ShutdownOnFailure and ShutdownOnSuccess just feel right to use.<o:p></o:p></span></li><li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1"><span style="font-family:"Courier New"">In IntelliJ the Javadoc of StructuredTaskScope doesn’t seem to properly format and makes it very difficult to read (probably an issue with IntelliJ).<o:p></o:p></span></li><li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1"><span style="font-family:"Courier New"">Blocking IO is not interruptible and this can cause confusion when the scope won’t close in a timely manner even though something may have already
 thrown an exception (probably falls under the Non-Goal of thread cancellation mechanism). e.g. 2 calls to fork one reading a short file and the other reading an long file, short one fails, if I don’t do something to close the long file stream I will read the
 whole thing (making ShutdownOnFailure not really live up to its name).<o:p></o:p></span></li></ul>
<p class="MsoNormal"><span style="font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">I love that StructuredTaskScope interrupts threads on close/shutdown (it allows some short-circuiting that I struggled with when using Executors.newVirtualThreadPerTaskExecutor()). Here is my new
 favorite code snippet using StructuredTaskScope:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">#</span><span style="font-size:9.0pt;font-family:Menlo;color:#D4D4D4;mso-ligatures:none">!</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">java
</span><span style="font-size:9.0pt;font-family:Menlo;color:#D4D4D4;mso-ligatures:none">--</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">source
</span><span style="font-size:9.0pt;font-family:Menlo;color:#B5CEA8;mso-ligatures:none">23</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#D4D4D4;mso-ligatures:none">--</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">enable</span><span style="font-size:9.0pt;font-family:Menlo;color:#D4D4D4;mso-ligatures:none">-</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">preview<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#569CD6;mso-ligatures:none">import</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#D4D4D4;mso-ligatures:none">java.io.*</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">;<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#569CD6;mso-ligatures:none">import</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#D4D4D4;mso-ligatures:none">java.util.concurrent.*</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">;<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#569CD6;mso-ligatures:none">import</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#D4D4D4;mso-ligatures:none">java.util.function.Supplier</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">;<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#4EC9B0;mso-ligatures:none">void</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#DCDCAA;mso-ligatures:none">main</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">() throws ExecutionException, InterruptedException, IOException {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none"> 
</span><span style="font-size:9.0pt;font-family:Menlo;color:#9CDCFE;mso-ligatures:none">System</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">.</span><span style="font-size:9.0pt;font-family:Menlo;color:#9CDCFE;mso-ligatures:none">out</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">.</span><span style="font-size:9.0pt;font-family:Menlo;color:#DCDCAA;mso-ligatures:none">println</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">(</span><span style="font-size:9.0pt;font-family:Menlo;color:#DCDCAA;mso-ligatures:none">process</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">(</span><span style="font-size:9.0pt;font-family:Menlo;color:#CE9178;mso-ligatures:none">"Hello,
 World!"</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">,
</span><span style="font-size:9.0pt;font-family:Menlo;color:#CE9178;mso-ligatures:none">"cat"</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">));<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">}<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#4EC9B0;mso-ligatures:none">ProcessResult</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#DCDCAA;mso-ligatures:none">process</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">(</span><span style="font-size:9.0pt;font-family:Menlo;color:#4EC9B0;mso-ligatures:none">String</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
 input, </span><span style="font-size:9.0pt;font-family:Menlo;color:#4EC9B0;mso-ligatures:none">String</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">...
</span><span style="font-size:9.0pt;font-family:Menlo;color:#9CDCFE;mso-ligatures:none">command</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">)<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">    throws ExecutionException, InterruptedException, IOException {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none"> 
</span><span style="font-size:9.0pt;font-family:Menlo;color:#C586C0;mso-ligatures:none">try</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none"> (</span><span style="font-size:9.0pt;font-family:Menlo;color:#569CD6;mso-ligatures:none">var</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#9CDCFE;mso-ligatures:none">scope</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#D4D4D4;mso-ligatures:none">=</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#C586C0;mso-ligatures:none">new</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none"> StructuredTaskScope.</span><span style="font-size:9.0pt;font-family:Menlo;color:#DCDCAA;mso-ligatures:none">ShutdownOnFailure</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">())
 {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">   
</span><span style="font-size:9.0pt;font-family:Menlo;color:#569CD6;mso-ligatures:none">var</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#9CDCFE;mso-ligatures:none">process</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#D4D4D4;mso-ligatures:none">=</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#C586C0;mso-ligatures:none">new</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#DCDCAA;mso-ligatures:none">ProcessBuilder</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">(command).</span><span style="font-size:9.0pt;font-family:Menlo;color:#DCDCAA;mso-ligatures:none">start</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">();<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">   
</span><span style="font-size:9.0pt;font-family:Menlo;color:#9CDCFE;mso-ligatures:none">scope</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">.</span><span style="font-size:9.0pt;font-family:Menlo;color:#DCDCAA;mso-ligatures:none">fork</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">(</span><span style="font-size:9.0pt;font-family:Menlo;color:#DCDCAA;mso-ligatures:none">write</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">(process</span><span style="font-size:9.0pt;font-family:Menlo;color:#C586C0;mso-ligatures:none">::</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">getOutputStream,
 input));<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">   
</span><span style="font-size:9.0pt;font-family:Menlo;color:#569CD6;mso-ligatures:none">var</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#9CDCFE;mso-ligatures:none">stdout</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#D4D4D4;mso-ligatures:none">=</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#9CDCFE;mso-ligatures:none">scope</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">.</span><span style="font-size:9.0pt;font-family:Menlo;color:#DCDCAA;mso-ligatures:none">fork</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">(</span><span style="font-size:9.0pt;font-family:Menlo;color:#DCDCAA;mso-ligatures:none">read</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">(process</span><span style="font-size:9.0pt;font-family:Menlo;color:#C586C0;mso-ligatures:none">::</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">getInputStream));<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">   
</span><span style="font-size:9.0pt;font-family:Menlo;color:#569CD6;mso-ligatures:none">var</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#9CDCFE;mso-ligatures:none">stderr</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#D4D4D4;mso-ligatures:none">=</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#9CDCFE;mso-ligatures:none">scope</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">.</span><span style="font-size:9.0pt;font-family:Menlo;color:#DCDCAA;mso-ligatures:none">fork</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">(</span><span style="font-size:9.0pt;font-family:Menlo;color:#DCDCAA;mso-ligatures:none">read</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">(process</span><span style="font-size:9.0pt;font-family:Menlo;color:#C586C0;mso-ligatures:none">::</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">getErrorStream));<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">   
</span><span style="font-size:9.0pt;font-family:Menlo;color:#569CD6;mso-ligatures:none">var</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#9CDCFE;mso-ligatures:none">exitValue</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#D4D4D4;mso-ligatures:none">=</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#9CDCFE;mso-ligatures:none">scope</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">.</span><span style="font-size:9.0pt;font-family:Menlo;color:#DCDCAA;mso-ligatures:none">fork</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">(</span><span style="font-size:9.0pt;font-family:Menlo;color:#DCDCAA;mso-ligatures:none">waitForOrDestroy</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">(process));<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">   
</span><span style="font-size:9.0pt;font-family:Menlo;color:#9CDCFE;mso-ligatures:none">scope</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">.</span><span style="font-size:9.0pt;font-family:Menlo;color:#DCDCAA;mso-ligatures:none">join</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">().</span><span style="font-size:9.0pt;font-family:Menlo;color:#DCDCAA;mso-ligatures:none">throwIfFailed</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">();<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">   
</span><span style="font-size:9.0pt;font-family:Menlo;color:#C586C0;mso-ligatures:none">return</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#C586C0;mso-ligatures:none">new</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#DCDCAA;mso-ligatures:none">ProcessResult</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">(</span><span style="font-size:9.0pt;font-family:Menlo;color:#9CDCFE;mso-ligatures:none">stdout</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">.</span><span style="font-size:9.0pt;font-family:Menlo;color:#DCDCAA;mso-ligatures:none">get</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">(),
</span><span style="font-size:9.0pt;font-family:Menlo;color:#9CDCFE;mso-ligatures:none">stderr</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">.</span><span style="font-size:9.0pt;font-family:Menlo;color:#DCDCAA;mso-ligatures:none">get</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">(),
</span><span style="font-size:9.0pt;font-family:Menlo;color:#9CDCFE;mso-ligatures:none">exitValue</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">.</span><span style="font-size:9.0pt;font-family:Menlo;color:#DCDCAA;mso-ligatures:none">get</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">());<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">  }<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">}<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#4EC9B0;mso-ligatures:none">Callable</span><span style="font-size:9.0pt;font-family:Menlo;color:#D4D4D4;mso-ligatures:none"><</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">Void</span><span style="font-size:9.0pt;font-family:Menlo;color:#D4D4D4;mso-ligatures:none">></span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#DCDCAA;mso-ligatures:none">write</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">(</span><span style="font-size:9.0pt;font-family:Menlo;color:#4EC9B0;mso-ligatures:none">Supplier</span><span style="font-size:9.0pt;font-family:Menlo;color:#D4D4D4;mso-ligatures:none"><</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">OutputStream</span><span style="font-size:9.0pt;font-family:Menlo;color:#D4D4D4;mso-ligatures:none">></span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
 outputStreamSupplier, </span><span style="font-size:9.0pt;font-family:Menlo;color:#4EC9B0;mso-ligatures:none">String</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none"> input) {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none"> 
</span><span style="font-size:9.0pt;font-family:Menlo;color:#C586C0;mso-ligatures:none">return</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none"> ()
</span><span style="font-size:9.0pt;font-family:Menlo;color:#569CD6;mso-ligatures:none">-></span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none"> {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">   
</span><span style="font-size:9.0pt;font-family:Menlo;color:#C586C0;mso-ligatures:none">try</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none"> (</span><span style="font-size:9.0pt;font-family:Menlo;color:#569CD6;mso-ligatures:none">var</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#9CDCFE;mso-ligatures:none">outputStream</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#D4D4D4;mso-ligatures:none">=</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#9CDCFE;mso-ligatures:none">outputStreamSupplier</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">.</span><span style="font-size:9.0pt;font-family:Menlo;color:#DCDCAA;mso-ligatures:none">get</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">())
 {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">     
</span><span style="font-size:9.0pt;font-family:Menlo;color:#9CDCFE;mso-ligatures:none">outputStream</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">.</span><span style="font-size:9.0pt;font-family:Menlo;color:#DCDCAA;mso-ligatures:none">write</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">(</span><span style="font-size:9.0pt;font-family:Menlo;color:#9CDCFE;mso-ligatures:none">input</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">.</span><span style="font-size:9.0pt;font-family:Menlo;color:#DCDCAA;mso-ligatures:none">getBytes</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">());<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">     
</span><span style="font-size:9.0pt;font-family:Menlo;color:#C586C0;mso-ligatures:none">return</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#569CD6;mso-ligatures:none">null</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">;<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">    }<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">  };<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">}<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#4EC9B0;mso-ligatures:none">Callable</span><span style="font-size:9.0pt;font-family:Menlo;color:#D4D4D4;mso-ligatures:none"><</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">String</span><span style="font-size:9.0pt;font-family:Menlo;color:#D4D4D4;mso-ligatures:none">></span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#DCDCAA;mso-ligatures:none">read</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">(</span><span style="font-size:9.0pt;font-family:Menlo;color:#4EC9B0;mso-ligatures:none">Supplier</span><span style="font-size:9.0pt;font-family:Menlo;color:#D4D4D4;mso-ligatures:none"><</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">InputStream</span><span style="font-size:9.0pt;font-family:Menlo;color:#D4D4D4;mso-ligatures:none">></span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
 inputStreamSupplier) {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none"> 
</span><span style="font-size:9.0pt;font-family:Menlo;color:#C586C0;mso-ligatures:none">return</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none"> ()
</span><span style="font-size:9.0pt;font-family:Menlo;color:#569CD6;mso-ligatures:none">-></span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none"> {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">   
</span><span style="font-size:9.0pt;font-family:Menlo;color:#C586C0;mso-ligatures:none">try</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none"> (</span><span style="font-size:9.0pt;font-family:Menlo;color:#569CD6;mso-ligatures:none">var</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#9CDCFE;mso-ligatures:none">inputStream</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#D4D4D4;mso-ligatures:none">=</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#9CDCFE;mso-ligatures:none">inputStreamSupplier</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">.</span><span style="font-size:9.0pt;font-family:Menlo;color:#DCDCAA;mso-ligatures:none">get</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">())
 {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">     
</span><span style="font-size:9.0pt;font-family:Menlo;color:#C586C0;mso-ligatures:none">return</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#C586C0;mso-ligatures:none">new</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#DCDCAA;mso-ligatures:none">String</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">(</span><span style="font-size:9.0pt;font-family:Menlo;color:#9CDCFE;mso-ligatures:none">inputStream</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">.</span><span style="font-size:9.0pt;font-family:Menlo;color:#DCDCAA;mso-ligatures:none">readAllBytes</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">());<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">    }<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">  };<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">}<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#4EC9B0;mso-ligatures:none">Callable</span><span style="font-size:9.0pt;font-family:Menlo;color:#D4D4D4;mso-ligatures:none"><</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">Integer</span><span style="font-size:9.0pt;font-family:Menlo;color:#D4D4D4;mso-ligatures:none">></span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#DCDCAA;mso-ligatures:none">waitForOrDestroy</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">(</span><span style="font-size:9.0pt;font-family:Menlo;color:#4EC9B0;mso-ligatures:none">Process</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
 process) {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none"> 
</span><span style="font-size:9.0pt;font-family:Menlo;color:#C586C0;mso-ligatures:none">return</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none"> ()
</span><span style="font-size:9.0pt;font-family:Menlo;color:#569CD6;mso-ligatures:none">-></span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none"> {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">   
</span><span style="font-size:9.0pt;font-family:Menlo;color:#C586C0;mso-ligatures:none">try</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none"> {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">     
</span><span style="font-size:9.0pt;font-family:Menlo;color:#C586C0;mso-ligatures:none">return</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#9CDCFE;mso-ligatures:none">process</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">.</span><span style="font-size:9.0pt;font-family:Menlo;color:#DCDCAA;mso-ligatures:none">waitFor</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">();<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">    }
</span><span style="font-size:9.0pt;font-family:Menlo;color:#C586C0;mso-ligatures:none">catch</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none"> (</span><span style="font-size:9.0pt;font-family:Menlo;color:#4EC9B0;mso-ligatures:none">InterruptedException</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#9CDCFE;mso-ligatures:none">e</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">) {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">     
</span><span style="font-size:9.0pt;font-family:Menlo;color:#9CDCFE;mso-ligatures:none">process</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">.</span><span style="font-size:9.0pt;font-family:Menlo;color:#DCDCAA;mso-ligatures:none">destroy</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">();<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">     
</span><span style="font-size:9.0pt;font-family:Menlo;color:#C586C0;mso-ligatures:none">throw</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none"> e;<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">    }<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">  };<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">}<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#569CD6;mso-ligatures:none">record</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
</span><span style="font-size:9.0pt;font-family:Menlo;color:#4EC9B0;mso-ligatures:none">ProcessResult</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">(</span><span style="font-size:9.0pt;font-family:Menlo;color:#4EC9B0;mso-ligatures:none">String</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none">
 stdout, </span><span style="font-size:9.0pt;font-family:Menlo;color:#4EC9B0;mso-ligatures:none">String</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none"> stderr,
</span><span style="font-size:9.0pt;font-family:Menlo;color:#4EC9B0;mso-ligatures:none">int</span><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none"> exitValue) {}<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:#1F1F1F"><span style="font-size:9.0pt;font-family:Menlo;color:#CCCCCC;mso-ligatures:none"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""><o:p> </o:p></span></p>
</div>

<DIV>
This e-mail, including attachments, may include confidential and/or<BR>
proprietary information, and may be used only by the person or entity<BR>
to which it is addressed. If the reader of this e-mail is not the intended<BR>
recipient or intended recipient’s authorized agent, the reader is hereby<BR>
notified that any dissemination, distribution or copying of this e-mail is<BR>
prohibited. If you have received this e-mail in error, please notify the<BR>
sender by replying to this message and delete this e-mail immediately.<BR>
</DIV></body>
</html>