Пример #1
0
 public void Execute()
 {
     try {
         var result = Func();
         Future.SetResult(result, null);
     } catch (Exception exc) {
         Future.SetResult2(default(T), ExceptionDispatchInfo.Capture(exc));
     }
 }
Пример #2
0
 public static void Fail <T> (this Future <T> future, Exception error)
 {
     future.SetResult2(default(T), ExceptionDispatchInfo.Capture(error));
 }