Exemplo n.º 1
0
 public static NonThrowingFuture <TResult> DoNotThrow <TResult> (this Future <TResult> future)
 {
     return(new NonThrowingFuture <TResult> {
         Future = future
     });
 }
Exemplo n.º 2
0
 public static VoidFutureAwaiter GetAwaiter(this Future <NoneType> future)
 {
     return(new VoidFutureAwaiter(future));
 }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 public static FutureAwaiter <T> GetAwaiter <T> (this Future <T> future)
 {
     return(new FutureAwaiter <T>(future, true));
 }