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)); }
public static Promise <T> ToPromise <T>( this Task <T> task, CancellationTokenSource cancellationTokenSource, ChildCancelMode mode = ChildCancelMode.All) { return(new Promise <T>(task, cancellationTokenSource, mode)); }
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)); }