Future<T>
C# 中与 Java 最接近的等价物是什么?
例如,在 C# 中最接近以下内容的重构是什么:
public class FutureMethodCall implements Future {
private Future<APIResponse> methodCall;
public boolean cancel(boolean mayInterruptIfRunning) {
return this.methodCall.cancel(mayInterruptIfRunning);
}
public APIResponse get() throws ExecutionException, InterruptedException {
return this.methodCall.get();
}
...
}
提前致谢!