Quantcast
Channel: User Sinatr - Stack Overflow
Viewing all articles
Browse latest Browse all 601

Comment by Sinatr on Async Await Unexpected behaviour

$
0
0
Here65 is printed at the end as expected. Without await Task.Delay there is nothing running asynchronously. Replace it with Thread.Sleep to have issue again, because in this case LongRunningOperationAsync is actually a synchronous method and it needs to be run with e.g. Task.Run (for which you await), to have expected behavior.

Viewing all articles
Browse latest Browse all 601

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>