private static void DoWork <T>(Func <T> work, ResultFuture <T> future) { try { future.Set(work()); } catch (Exception e) { future.Failed(e); } }
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); } }