Exemple #1
0
 public static Promise <T> ToPromise <T>(
     this Task <T> task,
     CancellationToken cancellationToken = default(CancellationToken),
     ChildCancelMode mode = ChildCancelMode.All)
 {
     return(new Promise <T>(task, cancellationToken, mode));
 }
Exemple #2
0
 public static Promise <T> ToPromise <T>(
     this Task <T> task,
     CancellationTokenSource cancellationTokenSource,
     ChildCancelMode mode = ChildCancelMode.All)
 {
     return(new Promise <T>(task, cancellationTokenSource, mode));
 }
Exemple #3
0
 public static Promise <object> ToPromise(
     this Task task,
     CancellationTokenSource cancellationTokenSource,
     ChildCancelMode mode = ChildCancelMode.All)
 {
     return(task.ContinueWith(t => GetResult(t), cancellationTokenSource.Token)
            .ToPromise(cancellationTokenSource, mode));
 }