I have a simple action like this:
[HttpGet]
public async Task<string> GetHtml()
{
Console.WriteLine("Run=======================================================");
await Task.Delay(5000);
Console.WriteLine("End=======================================================");
return "ok";
}
I open three windows quickly, and go to the URL. I expected the result to look like:
Run=======================================================
Run=======================================================
Run=======================================================
End=======================================================
End=======================================================
End=======================================================
But, It's not! Instead, the result was:
Run=======================================================
End=======================================================
Run=======================================================
End=======================================================
Run=======================================================
End=======================================================
In addition, when the first run is finished, the second request begins. Why?