ASP.net MVC Runs asynchronously

Is there a way to get the controller to return something to the user first and then execute another method?

I have a process that takes a lot of time. I would like to send back a quick JSON response to the user and then process it.

+3
source share
2 answers

In this case, you might consider running the current task in the workflow. The MVC loop must complete in order to return the response to the caller. Please note: background threads will not have access to the request context, so you must capture everything you need. Also note that you cannot return anything to the caller after the http context has logged out - you will need to call to get additional data.

+5
source
+2
source

All Articles