Skip to content

Instantly share code, notes, and snippets.

@korchoon
Created October 18, 2020 08:04
Show Gist options
  • Save korchoon/933c27635d9455f5b8f0995b77eee9f2 to your computer and use it in GitHub Desktop.
Save korchoon/933c27635d9455f5b8f0995b77eee9f2 to your computer and use it in GitHub Desktop.
async Routine EnabledDisabledFlow() {
while (true) {
await Routine.Yield;
if (!enabled)
await Routine.TryAwait(() => enabled)
.Configure(child: DisabledFlow());
await Routine.TryAwait(() => !enabled)
.Configure(child: EnabledFlow());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment