Skip to content

Instantly share code, notes, and snippets.

@sdether
Created January 12, 2012 07:19
Show Gist options
  • Select an option

  • Save sdether/1599213 to your computer and use it in GitHub Desktop.

Select an option

Save sdether/1599213 to your computer and use it in GitHub Desktop.
class Exponentiator {
public static IEnumerator Coroutine(Coordinator<int[]> coordinator) {
while(true) {
if(coordinator.State == null) {
continue;
}
if(coordinator.State.Length == 0) {
Console.WriteLine("consumer finished, end of input");
yield break;
}
for(int i = 0; i < coordinator.State.Length; i++) {
var item = coordinator.State[i];
coordinator.State[i] = item * item;
}
yield return coordinator;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment