标签:cancellation
-
简便的方法来等待已取消的任务? - c#
我发现自己经常这样编写代码: try { cancellationTokenSource.Cancel(); await task.ConfigureAwait(false); // this is the task that was cancelled } catch(OperationCanceledException) { // Cancellatio […]
我发现自己经常这样编写代码: try { cancellationTokenSource.Cancel(); await task.ConfigureAwait(false); // this is the task that was cancelled } catch(OperationCanceledException) { // Cancellatio […]