I've an application which has some controller's actions calling slow 3rd party web services. These actions are called using AJAX calls from the page.
I can use async controllers to free ASP.NET thread pool, that's great. But what about session? If I use InProc session and a request made to "slow action" the particular user can't make any request to the application because his session is locked by first "slow" call.
In PHP there is a method session_write_close()
which I can use as following:
- Accept user's request to slow action
- Check rights of the user to access controller/action based on session data
- Write something to the session if needed
- Call
session_write_close()
. From this point session is closed by this request and any other request from the same user can access it - Make my slow call (maybe in some async way)
I know that I can disable session state on the controller level using [SessionState]
attribute, but that's not the solution.
Any ideas?