Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void Callback(this Task task, Action action)
- {
- Task.Factory.StartNew(sourceTask => {
- while (true)
- {
- if (((Task)sourceTask).IsCompleted)
- {
- action.Invoke();
- return false;
- }
- Thread.Sleep(5000);
- }
- }, task);
- }
Add Comment
Please, Sign In to add comment