I have the following code:
static async Task Callee() { await Task.Delay(1000); } static async Task Caller() { Callee();
# 1 is triggered and forgotten in the easiest way. # 2 is just waiting. Interesting material begins with number 3. What is the deep logic of calls?
I know about using fire'n'forget warnings in ASP.NET, as stated here . I ask this because we move our application to the service fabric, where we can no longer use HostingEnvironment.QueueBackgroundWorkItem(async cancellationToken => await LongMethodAsync()); , and the advice is to simply replace it with Task.Run .
I see Task.Run starting a new thread, what will be the difference between # 3 and # 5?
source share