I'm new to ASP.NET Core, so maybe I'm doing something wrong, here is my issue:
What do I need: After loading start page start loading application specific data from Azure Storage in background and show it's status on front-end
What I did to achieve this:
public ViewResult Index()
{
var homeModel = new HomeModel();
Task.Run(() =>
{
// Some specific work to do...
System.Threading.Thread.Sleep(4000);
});
return View(homeModel);
}
When I run this code front-end view doesn't displayed until Task is not finished, even though it's different managed thread (also I tried to do the same with new Thread.Start(() => ...); ).
My question is: What it the reason of such behavior? As I said I'm new to ASP.NET Core and I've not worked with ASP.NET of previous versions.
I have some ideas how to work around with this behavior but I want to know the right way to do it and understand the reason :)
P.S. I'm using SignalR for updating views from back-end.