<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : async and await</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : Community Forum : async and await</description>
  <pubDate>Sat, 11 Apr 2026 07:39:35 -700</pubDate>
  <lastBuildDate>Sat, 07 Apr 2012 11:00:08 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=3305</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>async and await : Justresurrectingthis thread. The...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3305&amp;PID=13249#13249</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1005" rel="nofollow">mgood</a><br /><strong>Subject:</strong> 3305<br /><strong>Posted:</strong> 07-Apr-2012 at 11:00am<br /><br />Just&nbsp;resurrecting&nbsp;this thread. The latest Cocktail source code has now support for the Task-based Asynchronous Pattern in WPF and SL5.&nbsp;<div><br></div><div><a href="http://cocktail.codeplex.com/SourceC&#111;ntrol/list/changesets" target="_blank">http://cocktail.codeplex.com/SourceControl/list/changesets</a>&nbsp;</div><div><br></div><div>This will be part of the next release.<br><div><br></div><div>If you are using the Async CTP, add the following class to your project in order to make all Cocktail asynchronous operations awaitable:</div><div><br></div><div><div>using System.Runtime.CompilerServices;</div><div><br></div><div>namespace Cocktail</div><div>{</div><div>&nbsp; &nbsp; public static class AwaitFns</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; public static TaskAwaiter&lt;T&gt; GetAwaiter&lt;T&gt;(this OperationResult&lt;T&gt; operation)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return operation.AsTask().GetAwaiter();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; public static TaskAwaiter GetAwaiter(this OperationResult operation)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return operation.AsTask().GetAwaiter();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; public static TaskAwaiter&lt;T&gt; GetAwaiter&lt;T&gt;(this DialogOperationResult&lt;T&gt; operation)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return operation.AsTask().GetAwaiter();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; }</div><div>}</div></div></div>]]>
   </description>
   <pubDate>Sat, 07 Apr 2012 11:00:08 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3305&amp;PID=13249#13249</guid>
  </item> 
  <item>
   <title>async and await :  I have been using the async...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3305&amp;PID=12870#12870</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=945" rel="nofollow">mseeli</a><br /><strong>Subject:</strong> 3305<br /><strong>Posted:</strong> 29-Feb-2012 at 11:29pm<br /><br />I have been using the async CTP in my project for month now. It works just fine.&nbsp;<div>Here my wrapper around DevForce query.ExecuteAsync:</div><div><br></div><div><pre style="font-family: C&#111;nsolas; font-size: 13px; -: initial; -attachment: initial; -origin: initial; -clip: initial; : white; -: initial initial; -repeat: initial initial; ">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">public</span>&nbsp;<span style="color:blue;">static</span>&nbsp;<span style="color:blue;">class</span>&nbsp;<span style="color:#2b91af;">VisExtensions</span>&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">static</span>&nbsp;<span style="color:blue;">readonly</span>&nbsp;<span style="color:#2b91af;">ILog</span>&nbsp;Log&nbsp;=&nbsp;<span style="color:#2b91af;">LogManager</span>.GetLog(<span style="color:blue;">typeof</span>(<span style="color:#2b91af;">VisExtensions</span>)); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">public</span>&nbsp;<span style="color:blue;">static</span>&nbsp;<span style="color:#2b91af;">Task</span>&lt;<span style="color:#2b91af;">List</span>&lt;T&gt;&gt;&nbsp;VisExecuteAsync&lt;T&gt;(<span style="color:blue;">this</span>&nbsp;<span style="color:#2b91af;">IEntityQuery</span>&lt;T&gt;&nbsp;query)&nbsp;<span style="color:blue;">where</span>&nbsp;T&nbsp;:&nbsp;<span style="color:#2b91af;">Entity</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">var</span>&nbsp;tcs&nbsp;=&nbsp;<span style="color:blue;">new</span>&nbsp;<span style="color:#2b91af;">TaskCompletionSource</span>&lt;<span style="color:#2b91af;">List</span>&lt;T&gt;&gt;();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;query.ExecuteAsync(op&nbsp;=&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">if</span>&nbsp;(op.Error&nbsp;!=&nbsp;<span style="color:blue;">null</span>)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#2b91af;">Exception</span>&nbsp;ex2&nbsp;=&nbsp;<span style="color:blue;">new</span>&nbsp;<span style="color:#2b91af;">Exception</span>(<span style="color:#a31515;">"VisExtensions.VisExecuteAsync.Query.ExecuteAsync:&nbsp;Exception"</span>,&nbsp;op.Error);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log.Error(ex2);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tcs.TrySetException(op.Error);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">else</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#2b91af;">List</span>&lt;T&gt;&nbsp;resultList&nbsp;=&nbsp;<span style="color:blue;">new</span>&nbsp;<span style="color:#2b91af;">List</span>&lt;T&gt;();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">foreach</span>&nbsp;(<span style="color:blue;">var</span>&nbsp;r&nbsp;<span style="color:blue;">in</span>&nbsp;op.Results)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;resultList.Add(r);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tcs.TrySetResult(resultList);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">return</span>&nbsp;tcs.Task;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</pre><pre style="font-family: C&#111;nsolas; font-size: 13px; -: initial; -attachment: initial; -origin: initial; -clip: initial; : white; -: initial initial; -repeat: initial initial; ">    }</pre><pre style="font-family: C&#111;nsolas; font-size: 13px; -: initial; -attachment: initial; -origin: initial; -clip: initial; : white; -: initial initial; -repeat: initial initial; "><br></pre></div>]]>
   </description>
   <pubDate>Wed, 29 Feb 2012 23:29:38 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3305&amp;PID=12870#12870</guid>
  </item> 
  <item>
   <title>async and await :   No problem.Keep up the good...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3305&amp;PID=12862#12862</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=770" rel="nofollow">GeorgeB</a><br /><strong>Subject:</strong> 3305<br /><strong>Posted:</strong> 29-Feb-2012 at 10:48am<br /><br />No problem.<div>&nbsp;</div><div>Keep up the good work with Cocktail.</div>]]>
   </description>
   <pubDate>Wed, 29 Feb 2012 10:48:05 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3305&amp;PID=12862#12862</guid>
  </item> 
  <item>
   <title>async and await :   Oh btw, in the meantime, there&amp;#039;s...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3305&amp;PID=12861#12861</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1005" rel="nofollow">mgood</a><br /><strong>Subject:</strong> 3305<br /><strong>Posted:</strong> 29-Feb-2012 at 10:47am<br /><br />Oh btw, in the meantime, there's nothing stopping you from writing a wrapper that wraps a DevForce asynchronous operation as a&nbsp;Task, so you could do the following. Take a look at AsOperationResult for how Cocktail wraps a DevForce operation as an OperationResult&lt;T&gt;, which implements IResult in order to be consumable from a Caliburn Coroutine. Wrapping it as a Task is not much different. <div>&nbsp;</div><div><span style="color: blue;"><pre style="color: black; font-family: C&#111;nsolas;"><span style="color: blue;">public</span> <span style="color: blue;">async</span> <span>Task</span>&lt;<span>EntitySaveOperation</span>&gt; SaveAsync(<span>Action</span>&lt;<span>IEnumerable</span>&gt; onSuccess, <span>Action</span>&lt;<span>Exception</span>&gt; onFail)</pre></span>{<br>&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue;">return</span> <span style="color: blue;">await</span> Manager.SaveChangesAsync().AsTask();<br>}</div>]]>
   </description>
   <pubDate>Wed, 29 Feb 2012 10:47:58 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3305&amp;PID=12861#12861</guid>
  </item> 
  <item>
   <title>async and await :   No committment to supporting...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3305&amp;PID=12860#12860</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1005" rel="nofollow">mgood</a><br /><strong>Subject:</strong> 3305<br /><strong>Posted:</strong> 29-Feb-2012 at 10:43am<br /><br />No committment to supporting it before the official release of .NET 4.5, but we will support it.]]>
   </description>
   <pubDate>Wed, 29 Feb 2012 10:43:38 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3305&amp;PID=12860#12860</guid>
  </item> 
  <item>
   <title>async and await :   Just to be difficult? No seriously...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3305&amp;PID=12859#12859</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=770" rel="nofollow">GeorgeB</a><br /><strong>Subject:</strong> 3305<br /><strong>Posted:</strong> 29-Feb-2012 at 10:38am<br /><br />Just to be difficult? No seriously - we've used async / wait as much as we can in our app. <div>&nbsp;</div><div>I'm using coroutines but I just want keep everything standard.</div><div>&nbsp;</div><div>Now that we have a go-live beta of .Net 4.5, will we see anything soon?</div><div>&nbsp;</div><div>Kr</div><div>George</div>]]>
   </description>
   <pubDate>Wed, 29 Feb 2012 10:38:28 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3305&amp;PID=12859#12859</guid>
  </item> 
  <item>
   <title>async and await :   Neither Cocktail nor DevForce...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3305&amp;PID=12846#12846</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1005" rel="nofollow">mgood</a><br /><strong>Subject:</strong> 3305<br /><strong>Posted:</strong> 28-Feb-2012 at 1:32pm<br /><br />Neither Cocktail nor DevForce supports Task and async/await yet. It's still CTP. What's wrong with Coroutines? They do everything async/await does without the syntax sugar. ]]>
   </description>
   <pubDate>Tue, 28 Feb 2012 13:32:49 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3305&amp;PID=12846#12846</guid>
  </item> 
  <item>
   <title>async and await :   Hi Okay just in case someone...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3305&amp;PID=12844#12844</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=770" rel="nofollow">GeorgeB</a><br /><strong>Subject:</strong> 3305<br /><strong>Posted:</strong> 28-Feb-2012 at 11:17am<br /><br />Hi<div> </div><div>Okay just in case someone asks:-</div><div> </div><div>I have a 3 step process which has to save a record, then if that is successful, save a record to another table, and if that is successful, save a another record to a third table.</div><div> </div><div>This is running inside a foreach loop where I might make 20 iterations.</div><div> </div><div>Thanks</div><div>George</div>]]>
   </description>
   <pubDate>Tue, 28 Feb 2012 11:17:48 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3305&amp;PID=12844#12844</guid>
  </item> 
  <item>
   <title>async and await :    Hi For a number of reasons...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3305&amp;PID=12843#12843</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=770" rel="nofollow">GeorgeB</a><br /><strong>Subject:</strong> 3305<br /><strong>Posted:</strong> 28-Feb-2012 at 10:56am<br /><br />Hi<div> </div><div>For a number of reasons (too many to explain here) I would like to use async and await from the Async CTP in my Silverlight app.</div><div> </div><div>Any suggestions on how my (Cocktail) Repository might define the Manager.SaveChangesAsync() ?</div><div> </div><div>Tried this but EntitySaveOperation isn't 'awaitable'</div><div><pre style=": white; color: black; font-family: C&#111;nsolas;"><span style="color: blue;"><pre style=": white; color: black; font-family: C&#111;nsolas;"><span style="color: blue;">public</span> <span style="color: blue;">async</span> <span style="color: rgb43, 145, 175;">Task</span>&lt;<span style="color: rgb43, 145, 175;">EntitySaveOperation</span>&gt; SaveAsync(<span style="color: rgb43, 145, 175;">Action</span>&lt;<span style="color: rgb43, 145, 175;">IEnumerable</span>&gt; onSuccess, <span style="color: rgb43, 145, 175;">Action</span>&lt;<span style="color: rgb43, 145, 175;">Exception</span>&gt; onFail)</pre></span>{     <span style="color: blue;">return</span> <span style="color: blue;">await</span> Manager.SaveChangesAsync();}</pre></div><div> </div><div>Thanks</div><div>George</div><span style="font-size:10px"><br /><br />Edited by GeorgeB - 28-Feb-2012 at 11:06am</span>]]>
   </description>
   <pubDate>Tue, 28 Feb 2012 10:56:29 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3305&amp;PID=12843#12843</guid>
  </item> 
 </channel>
</rss>