public static NonThrowingFuture <TResult> DoNotThrow <TResult> (this Future <TResult> future) { return(new NonThrowingFuture <TResult> { Future = future }); }
public static VoidFutureAwaiter GetAwaiter(this Future <NoneType> future) { return(new VoidFutureAwaiter(future)); }
public static void BindFuture <T> (this System.Threading.Tasks.Task <T> task, Future <T> future) { if (task.IsCompleted) { future.SetResultFrom(task); return; } task.ConfigureAwait(false).GetAwaiter().OnCompleted(() => { future.SetResultFrom(task); }); future.RegisterOnDispose(CancelScopeForTask, task); }
public static FutureAwaiter <T> GetAwaiter <T> (this Future <T> future) { return(new FutureAwaiter <T>(future, true)); }