New answers tagged asynchronous
3
The Wait call is tricky.
It throws by default AggregateException not OperationCanceledException.
If you provide the cancellationToken to the Wait then it will throw an OperationCanceledException.
The biggest problem with this approach is that it cancels only the Wait not the underlying task.
Please read this article for more details.
So, if we switch to ...
Top 50 recent answers are included
Related Tags
asynchronous × 493c# × 181
javascript × 113
async-await × 69
python × 55
java × 53
node.js × 47
multithreading × 45
promise × 34
c++ × 29
.net × 29
python-3.x × 27
android × 26
http × 25
error-handling × 20
task-parallel-library × 20
performance × 19
thread-safety × 19
socket × 19
beginner × 17
concurrency × 16
callback × 16
jquery × 12
c++11 × 10
web-scraping × 10