Skip to content

Instantly share code, notes, and snippets.

@i3arnon
Created October 6, 2015 21:12
Show Gist options
  • Save i3arnon/53320776ca1f226763f6 to your computer and use it in GitHub Desktop.
Save i3arnon/53320776ca1f226763f6 to your computer and use it in GitHub Desktop.
Task<Task> task = Task.Factory.StartNew(async () =>
{
while (IsEnabled)
{
await FooAsync();
await Task.Delay(TimeSpan.FromSeconds(10));
}
}, TaskCreationOptions.LongRunning);
Task actualTask = task.Unwrap();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment