Beispiel #1
0
 private static void DoWork <T>(Func <T> work, ResultFuture <T> future)
 {
     try {
         future.Set(work());
     } catch (Exception e) {
         future.Failed(e);
     }
 }
Beispiel #2
0
 private static void DoWork <T, TResult>(T data, Func <T, TResult> work, ResultFuture <TResult> future)
 {
     try {
         future.Set(work(data));
     } catch (Exception e) {
         future.Failed(e);
     }
 }