【发布时间】:2012-01-09 16:45:02
【问题描述】:
如何将接受回调函数作为参数的现有异步方法包装到兼容任务并行库的方法中?
// Existing method
void DoAsync(Action<string> callback) {
...
}
// The desired method should have similar prototype
Task<string> DoAsync() {
// Internally this method should call existing
// version of DoAsync method (see above)
}
【问题讨论】:
标签: .net asynchronous task-parallel-library async-ctp