Return to View with Async Await
I have a process I would like to run in the background. This is executed with a click of an action link.
I have a process I would like to run in the background. This is executed with a click of an action link.
I think I’m not understanding something. I had thought that Task.Yield() forced a new thread/context to be started for a task but upon re-reading this answer it seems that it merely forces the method to be async. It will still be on the same context.
Since the very begining of writing ASP.NET applications when I wanted to add a threading there are 3 simple ways I can accomplish threading within my ASP.NET application :
During my reading about Asynchronous Programming in .Net 4.5 async and await keywords
I read Here the following paragraph
Consider the following (based on the default MVC template), which is a simplified version of some “stuff” that happens in the background – it completes fine, and shows the expected result, 20:
I’m trying to benchmark (using Apache bench) a couple of ASP.NET Web API 2.0 endpoints. One of which is synchronous and one async.
I am trying to run 3 database queries in parallel but I’m not sure that I am doing it correctly.
I’m using a library that relies on HttpContext.Current. The library is Facebook C# SDK, but my question should apply in other scenarios as well. I’d like to use this library from inside of a parallel thread. However, HttpContext.Current is not available in the parallel thread, so I’m thinking about caching it to a local variable and then setting it in the parallel thread like this:
I wonder why I should bother using async Task on controllers, when IIS already handles the concurrency for me?
I have an application that is working well in production, but I wonder if I could have implemented the concurrency better….