<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">be doesn't wait if it's defined as 
<div><br /></div>
<div>func <span style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue';">longCalculationB() async -> SomeType </span></div>
<div><span style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue';"><br /></span></div>
<div><span style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue';">which would be helpful if it's a long calculation, </span></div>
<div><span style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue';"><br /></span></div>
<div><span style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue';">in the case it's</span></div>
<div><span style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue';"><br /></span></div>
<div>func <span style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue';">longCalculationB() -> SomeType </span><span style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue';"><br /></span></div>
<div><span style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue';"><br /></span></div>
<div><font color="#333333" face="Helvetica Neue">That would probably be valid to put the async keyword front even though I would not be a big fan of that as you'd be executing on an indefinite queue a calculation that may not be thread safe.</font></div>
<div><font color="#333333" face="Helvetica Neue"><br /></font></div>
<div><font color="#333333" face="Helvetica Neue">async would be in that case a wrapper around dispatch_async  + semaphore</font></div>
<div><br /></div>
</div>
<div name="messageReplySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;"><br />
On 25 août 2017 18:08 -0400, Jonathan Hull <jhull@gbis.com>, wrote:<br />
<blockquote type="cite" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #1abc9c;">Why wouldn’t b wait for a in this example?  If it is using futures, those aren’t available in the current proposal.
<div class=""><br class="" />
<div>
<blockquote type="cite" class="" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #e67e22;">
<div class="">On Aug 25, 2017, at 3:02 PM, Florent Vilmart <<a href="mailto:florent@flovilmart.com" class="">florent@flovilmart.com</a>> wrote:</div>
<br class="Apple-interchange-newline" />
<div class="">
<div class="">
<div name="messageBodySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;" class="">Probably with:
<div class=""><br class="" /></div>
<div class="">
<div style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(51, 51, 51);" class="">let a = longCalculationA() </div>
<div style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(51, 51, 51);" class="">let b = longCalculationB() //b doesn’t wait for a to complete before starting</div>
<div style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(51, 51, 51);" class="">let c = longCalculationC() //c doesn’t wait for a or b</div>
<div style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(51, 51, 51);" class="">let (aResult, bResult, cResult) = await Future.collect(a, b, c) //waits until a, b, and c are all available</div>
</div>
</div>
<div name="messageReplySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;" class=""><br class="" />
On 25 août 2017 17:48 -0400, wrote:<br class="" />
<blockquote type="cite" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #3498db;" class=""><br class="" />
<div class="">let a = async longCalculationA()<br class="" />
let b = async longCalculationB() //b doesn’t wait for a to complete before starting<br class="" />
let c = async longCalculationC() //c doesn’t wait for a or b<br class="" />
let result = await combineCalculations(a: a, b: b, c: c) //waits until a, b, and c are all available</div>
</blockquote>
<div class=""></div>
</div>
</div>
</div>
</blockquote>
</div>
<br class="" /></div>
</blockquote>
<div></div>
</div>
</body>
</html>