Reputation: 705
I have an application form with 3 pages/steps. On the 2nd step, there are calls to potentially up to 2 external third party APIs, with the results of these calls stored in our local DB, before moving to step 3. I don't really care about the response from these APIs until the end of Step 3, where I then check the DB for the results to determine what should happen after step 3 is processed.
Currently, the API calls block the user from moving onto step 3. In the event that the request takes a while it leads to an unresponsive application and the possibility that the user will get fed up waiting. I'd like to make the application process more responsive by making the web calls asynchronous so that the user can begin completing step 3, by which time the results of step 2 should have been returned.
I can see that ASP.NET 4.5 has async and await methods which I think will probably help, but wondered what my options are in the meantime?
Upvotes: 0
Views: 290
Reputation: 81
If you dont care about return values from your async methods, then you can just delegate your blocking calls to a threadpool, and continue with no further changes to your code.
Have a look at System.Threading.ThreadPool.QueueUserWorkItem http://msdn.microsoft.com/en-us/library/4yd16hza.aspx
Upvotes: 1