Coroutines depending on result of a previous coroutine

Oct 18, 2010 at 11:14 PM

Hi all

I'm working on a Silverlight app that talks to several WCF endpoints. I'm using coroutines to fire off requests for processing with these endpoints, but often have to evaluate the results or prior coroutines before moving on.

Does anyone have any examples on how to evaluate the result of a coroutine before determining what else to do?

Example:

 

public IEnumerator<IResult> DoSomething()
        {
            yield return new Coroutine1();
            yield return new Coroutine2();
            // evaluate results of Coroutine2();
            // If true, show message1, else show message2
 
	   yield return new Coroutine3();
}

 

Coordinator
Oct 19, 2010 at 12:15 AM

var result = new Coroutine2();

yield return result;

 

//do something with result here

 

yield return new Coroutine3();

Oct 19, 2010 at 4:12 PM

Thank you!