Last active
December 9, 2017 17:03
-
-
Save EifelMono/58d9e7f3eca88e5b407dedf99f0feb75 to your computer and use it in GitHub Desktop.
Task.WhenAny(Task1, Task2, ....., CancellationTokenSource1.AsTask())
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class TasksExtensions | |
{ | |
public static Task AsTask(this CancellationTokenSource cancellationTokenSource, int delay= -1) | |
{ | |
return Task.Delay(delay, cancellationTokenSource.Token); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment