public static LTTask <T> FromException <T>(Exception ex) { var tcs = new LTTaskCompletionSource <T>(); tcs.TrySetException(ex); return(tcs.Task); }
public static LTTask <T> FromCanceled <T>(CancellationToken token) { var tcs = new LTTaskCompletionSource <T>(); tcs.TrySetException(new OperationCanceledException(token)); return(tcs.Task); }
public static LTTask FromException(Exception ex) { LTTaskCompletionSource tcs = new LTTaskCompletionSource(); tcs.TrySetException(ex); return(tcs.Task); }