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