2

I'm wondering about one thing - let's assume that the user clicks a button, and the asynch controller's action is invoked. What happens, when the asynchronous action takes e.g. 10 seconds? The user has to wait 10 seconds to view the result of the action? If so, are the asynch controllers really helpful ?

1 Answer 1

4

Yes. The user will have to wait 10s for his response -- though, if you have a long running action, you'd like want to invoke it via AJAX from a page rendered via another, shorter action.

The value of the asynchronous controller is that it doesn't block other requests on the same thread while the work is being done. Since you only have a limited number of threads, it is possible that they may all end up being blocked on requests to this action. If that happens, then the server cannot serve any requests. Using an asynchronous controller allows the thread to be returned to the thread pool while the asynchronous operation (wait on network or I/O) completes.

See this discussion on MSDN.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.