<?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 : Coroutine Start example</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Coroutine Start example</description>
  <pubDate>Mon, 27 Apr 2026 14:41:16 -700</pubDate>
  <lastBuildDate>Mon, 30 Apr 2012 19:11:00 -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=3400</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>Coroutine Start example : Hi Scott,Referring to your original...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3400&amp;PID=13462#13462</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 3400<br /><strong>Posted:</strong> 30-Apr-2012 at 7:11pm<br /><br />Hi Scott,<div><br></div><div>Referring to your original post, here's a post on our DRC showing how to do serial coroutines with function list.&nbsp;<a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/coroutine-functi&#111;n-list" target="_blank">http://drc.ideablade.com/xwiki/bin/view/Documentation/coroutine-function-list</a></div>]]>
   </description>
   <pubDate>Mon, 30 Apr 2012 19:11:00 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3400&amp;PID=13462#13462</guid>
  </item> 
  <item>
   <title>Coroutine Start example :   Thank you. That&amp;#039;s what...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3400&amp;PID=13396#13396</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1120" rel="nofollow">scottarlp</a><br /><strong>Subject:</strong> 3400<br /><strong>Posted:</strong> 24-Apr-2012 at 10:23am<br /><br />Thank you. That's what I needed. I've been trying to yield the method itself instead of the Coroutine.Start() inside the Chain() method and it just didn't dawn on me to nest the Coroutine.Starts inside there. I was hoping to be able to do without the Chain method, but that'll work great for now.<div>&nbsp;</div><div>Scott</div>]]>
   </description>
   <pubDate>Tue, 24 Apr 2012 10:23:01 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3400&amp;PID=13396#13396</guid>
  </item> 
  <item>
   <title>Coroutine Start example : I think I see where you&amp;#039;re...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3400&amp;PID=13394#13394</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1307" rel="nofollow">esaulsberry</a><br /><strong>Subject:</strong> 3400<br /><strong>Posted:</strong> 24-Apr-2012 at 8:00am<br /><br />I think I see where you're going now. &nbsp;DoThis and DoThat are themselves coroutine stacks? &nbsp;In which case I think you'll need another level of wrapper.<div><br></div><div><pre style="font-family: 'Bitstream Vera Sans Mono'; font-size: 15px; -: initial; -attachment: initial; -origin: initial; -clip: initial; : white; -: initial initial; -repeat: initial initial; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">private</span>&nbsp;<span style="color:#2b91af;">INotifyCompleted</span>&nbsp;CallChain()&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;op&nbsp;=&nbsp;IdeaBlade.EntityModel.<span style="color:#2b91af;">Coroutine</span>.Start(Chain);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;op.Completed&nbsp;+=&nbsp;(s,&nbsp;a)&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">if</span>&nbsp;(op.CompletedSuccessfully)&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;<span style="color:green;">//&nbsp;do&nbsp;something</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;};&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">return</span>&nbsp;op;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">private</span>&nbsp;<span style="color:#2b91af;">IEnumerable</span>&lt;<span style="color:#2b91af;">INotifyCompleted</span>&gt;&nbsp;Chain()&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;op1&nbsp;=&nbsp;IdeaBlade.EntityModel.<span style="color:#2b91af;">Coroutine</span>.Start(()&nbsp;=&gt;&nbsp;DoThis(x));&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">yield</span>&nbsp;<span style="color:blue;">return</span>&nbsp;op1; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">var</span>&nbsp;op2&nbsp;=&nbsp;IdeaBlade.EntityModel.<span style="color:#2b91af;">Coroutine</span>.Start(DoThat);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">yield</span>&nbsp;<span style="color:blue;">return</span>&nbsp;op2;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</pre></div>]]>
   </description>
   <pubDate>Tue, 24 Apr 2012 08:00:37 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3400&amp;PID=13394#13394</guid>
  </item> 
  <item>
   <title>Coroutine Start example : Scott,Both DoThis and DoThat should...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3400&amp;PID=13390#13390</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1307" rel="nofollow">esaulsberry</a><br /><strong>Subject:</strong> 3400<br /><strong>Posted:</strong> 24-Apr-2012 at 7:44am<br /><br />Scott,<div>Both DoThis and DoThat should be returning a single INotifyCompleted. &nbsp;Are they?</div><div><br></div><div>If not perhaps seeing more of the guts of them would help.</div><div><br></div><div>Elton</div>]]>
   </description>
   <pubDate>Tue, 24 Apr 2012 07:44:25 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3400&amp;PID=13390#13390</guid>
  </item> 
  <item>
   <title>Coroutine Start example :   Thanks for the replies. I...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3400&amp;PID=13388#13388</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1120" rel="nofollow">scottarlp</a><br /><strong>Subject:</strong> 3400<br /><strong>Posted:</strong> 24-Apr-2012 at 5:01am<br /><br />Thanks for the replies. I need to run the two methods in serial (one is semi-dependent on the other), so I don't think parellel will do the trick. Correct me if I'm wrong here.<div>&nbsp;</div><div>I tried esaulsberry's example, but the yield return DoThis(int x) { ... } portion inside DoStuff() gives a convert expression error. The method is a IEnumable list of INotifyCompleted and yield is expecting a single INotifyCompleted result. </div><div>&nbsp;</div><div>From looking at the overloads on Coroutine.Start(), it appeared there was a way to create a ienumable list you could pass and it would fire each in serial, but I either can't figure out the type of list (docs show something like IEnumerable&lt;Func&lt;INotifyCompleted&gt;&gt;) or it doesn't do what I thought it does.</div><div>&nbsp;</div><div>I can of course have a Coroutine.Start(...) of one method and then on the completed of it fire the next one, but that's just a couple steps away from outside Coroutine purpose to begin with (daisy callbacks). </div><div>&nbsp;</div><div>&nbsp;</div>]]>
   </description>
   <pubDate>Tue, 24 Apr 2012 05:01:11 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3400&amp;PID=13388#13388</guid>
  </item> 
  <item>
   <title>Coroutine Start example : If I understand you correctly,...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3400&amp;PID=13378#13378</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1307" rel="nofollow">esaulsberry</a><br /><strong>Subject:</strong> 3400<br /><strong>Posted:</strong> 23-Apr-2012 at 2:10pm<br /><br />If I understand you correctly, you'll need to add a method for the .Start() method to call, like this:<div><br></div><div>priviate IEnumerable&lt;INotifyCompleted&gt; DoStuff()</div><div>{</div><div><div style="text-align: left; : rgb251, 251, 253; "><span ="Apple-tab-span" style="white-space:pre">	</span>yield return DoThis(int x) { ... }</div><div style="text-align: left; : rgb251, 251, 253; "><br></div><div style="text-align: left; : rgb251, 251, 253; "><span ="Apple-tab-span" style="white-space:pre">	</span>yield return DoThat() {...}</div></div><div>}</div><div><br></div><div><br></div><div>Now call that from somewhere:</div><div><br></div><div>public void DoAsyncStuffForMe()</div><div>{</div><div><span ="Apple-tab-span" style="white-space:pre">	</span>Coroutine.Start(GetStatusData);</div><div>}<br><div><br></div><div><br></div><div>You can also set up the caller to notify when it's done:</div><div>public INotifiyCompleted DoAsyncStuffForMe(Action onSuccess)</div><div>{</div><div><span ="Apple-tab-span" style="white-space:pre">	</span>var op = Coroutine.Start(GetStatusData);</div><div><span ="Apple-tab-span" style="white-space:pre">	</span>op.Completed += (s, a) =&gt;</div><div><span ="Apple-tab-span" style="white-space:pre">	</span>{</div><div><span ="Apple-tab-span" style="white-space:pre">		</span>if(a.CompletedSuccessfully &amp;&amp; onSuccess != null)</div><div><span ="Apple-tab-span" style="white-space:pre">		</span>{</div><div><span ="Apple-tab-span" style="white-space:pre">			</span>onSuccess();</div><div><span ="Apple-tab-span" style="white-space:pre">		</span>}</div><div><span ="Apple-tab-span" style="white-space:pre">	</span>return op();</div><div>}</div><div><br></div></div>]]>
   </description>
   <pubDate>Mon, 23 Apr 2012 14:10:27 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3400&amp;PID=13378#13378</guid>
  </item> 
  <item>
   <title>Coroutine Start example : Hi Scott,Sounds like you might...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3400&amp;PID=13377#13377</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 3400<br /><strong>Posted:</strong> 23-Apr-2012 at 2:06pm<br /><br />Hi Scott,<div><br></div><div>Sounds like you might want to use Coroutine.StartParallel instead.&nbsp;<a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/parallel-async-coroutines" target="_blank">http://drc.ideablade.com/xwiki/bin/view/Documentation/parallel-async-coroutines</a></div>]]>
   </description>
   <pubDate>Mon, 23 Apr 2012 14:06:30 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3400&amp;PID=13377#13377</guid>
  </item> 
  <item>
   <title>Coroutine Start example :   I&amp;#039;ve apparently hit a...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3400&amp;PID=13376#13376</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1120" rel="nofollow">scottarlp</a><br /><strong>Subject:</strong> 3400<br /><strong>Posted:</strong> 23-Apr-2012 at 12:36pm<br /><br />I've apparently hit a dense point. I'm attempting to call multiple coroutine methods at once to keep from chaining the callbacks.<div>&nbsp;</div><div>Given two methods like the following:</div><div>&nbsp;</div><div>public IEnumerable&lt;INotifyCompleted&gt; DoThis(int x) { ... }</div><div>and</div><div>public IEnumerable&lt;INotifyCompleted&gt; DoThat() {...}</div><div>&nbsp;</div><div>How do I construct (or can I) the list to call Coroutine.Start(...)? I was trying to create a IEnumerable&lt;Func&lt;INotifyCompleted&gt;&gt; list, but I'm not having any luck adding the methods.</div><div>&nbsp;</div><div>Thanks for any help.</div><div>Scott</div>]]>
   </description>
   <pubDate>Mon, 23 Apr 2012 12:36:57 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3400&amp;PID=13376#13376</guid>
  </item> 
 </channel>
</rss>